Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

neon circular timer

neon_circular_timer

Make a timer application with a fancy neon effect and beautiful UI

v0.0.3 and above now the timer has also a neumorphic border

Preview of example

Usage

  NeonCircularTimer(
                width: 200,
                    duration: 20,
                    strokeWidth: 10,
                    textFormat: TextFormat.MM_SS,
                    isTimerTextShown: true,
                    neumorphicEffect: true,
                    textStyle: Theme.of(context).textTheme.headline3,
                    outerStrokeColor: Colors.grey.shade100,
                    fillGradient: LinearGradient(colors: [
                      Colors.greenAccent.shade200,
                      Colors.blueAccent.shade400
                    ]),
                    neonGradient: LinearGradient(colors: [
                      Colors.greenAccent.shade200,
                      Colors.blueAccent.shade400
                    ]),
                    strokeCap: StrokeCap.round,
                    fillColor: Colors.black12,
                    backgroudColor: Colors.grey.shade100,
                    neonColor: Colors.blue.shade900),

use neumorphicEffect to show or hide the neumorphic border

use isTimerTextShown to show or hide the text

with neumorphicEffect is true and isTimerTextShown is false

  NeonCircularTimer(
                width: 200,
                    duration: 20,
                    strokeWidth: 10,
                    textFormat: TextFormat.MM_SS,
                    isTimerTextShown: false,
                    neumorphicEffect: true,
                    textStyle: Theme.of(context).textTheme.headline3,
                    outerStrokeColor: Colors.grey.shade100,
                    fillGradient: LinearGradient(colors: [
                      Colors.greenAccent.shade200,
                      Colors.blueAccent.shade400
                    ]),
                    neonGradient: LinearGradient(colors: [
                      Colors.greenAccent.shade200,
                      Colors.blueAccent.shade400
                    ]),
                    strokeCap: StrokeCap.round,
                    fillColor: Colors.black12,
                    backgroudColor: Colors.grey.shade100,
                    neonColor: Colors.blue.shade900),

with neumorphicEffect is false and isTimerTextShown is false

  NeonCircularTimer(
                width: 200,
                    duration: 20,
                    strokeWidth: 10,
                    textFormat: TextFormat.MM_SS,
                    isTimerTextShown: false,
                    neumorphicEffect: false,
                    outerStrokeColor: Colors.grey.shade100,
                    fillGradient: LinearGradient(colors: [
                      Colors.greenAccent.shade200,
                      Colors.blueAccent.shade400
                    ]),
                    neonGradient: LinearGradient(colors: [
                      Colors.greenAccent.shade200,
                      Colors.blueAccent.shade400
                    ]),
                    strokeCap: StrokeCap.round,
                    fillColor: Colors.black12,
                    neonColor: Colors.blue.shade900),

Parameters

NameTypeDefault ValueDescription
keyKeynullKey for Countdown Timer.
durationintnullCountdown duration in Seconds.
initialDurationint0Countdown initial elapsed Duration in Seconds.
controllerCountDownControllernullControls (i.e Start, Pause, Resume, Restart) the Countdown Timer.
widthdoublenullWidth of the rectangle that surrounds the circle ( Diameter of the Countdown Timer).
neonColorColornullneon Color for Countdown Widget.
neonGradientGradientnullneon Gradient for Countdown Widget. Note that ringColor will not be effective if gradient is provided.
neumorphicEffectbooltrueshow neumorphic border
fillColorColornullFilling Color for Countdown Widget.
fillGradientGradientnullFilling Gradient for Countdown Widget. Note that fillColor will not be effective if gradient is provided.
outerStrokeColorColornullborder Color for Countdown Widget.
backgroundColorColornullmust be provided if you choose to use neumorphic effect .
outerStrokeGradientGradientnullborder Gradient for Countdown Widget. Note that backgroundColor will not be effective if gradient is provided.
strokeWidthdouble5.0Border Thickness of the Countdown Ring.
strokeCapStrokeCapStrokeCap.buttBegin and end contours with a flat edge and no extension.
textStyleTextStyleTextStyle(fontSize: 16.0,color: Colors.black,)Text Style for Countdown Text.
textFormatStringnullFormat for the Countdown Text.
isReverseboolfalseHandles Countdown Timer (true for Reverse Countdown (max to 0), false for Forward Countdown (0 to max)).
isReverseAnimationboolfalseHandles Animation Direction (true for Reverse Animation, false for Forward Animation).
isTimerTextShownbooltrueHandles visibility of the Countdown Text.
autoStartbooltrueHandles the timer start.
onStartVoidCallbacknullThis Callback will execute when the Countdown Starts.
onCompleteVoidCallbacknullThis Callback will execute when the Countdown Ends.

Download neon circular timer package source code on GitHub

https://github.com/yassinedevop/neon_circular_timer
Exit mobile version