MyCircularCountdownTimer class
A customizable countdown timer widget that displays a smooth circular progress arc and a center text showing a chain of time units (from the highest specified to the lowest) arranged from left to right (largest on the left, smallest on the right).
You define the countdown via separate optional relative amounts for each unit. Only the chain between your highest and lowest “specified” unit is displayed. All callbacks return the full breakdown as a CountdownTime object.
In addition, you have full control over the control button appearance: • You can set the container width/height, icon size, background color, icon color, and border radius. • A bottom overlay appears on mouse hover; you can control its color and height.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MyCircularCountdownTimer
Constructors
-
MyCircularCountdownTimer.new({Key? key, int years = 0, int months = 0, int weeks = 0, int days = 0, int hours = 0, int minutes = 0, int seconds = 0, VoidCallback? onComplete, ValueChanged<
CountdownTime> ? onPlay, ValueChanged<CountdownTime> ? onPause, ValueChanged<CountdownTime> ? onChangedTime, double size = 200, double strokeWidth = 10, Color backgroundColor = Colors.transparent, Color progressColor = Colors.green, Gradient? progressGradient, TextStyle textStyle = const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black), bool autoStart = true, bool showControlButton = true, Alignment controlButtonAlignment = Alignment.bottomCenter, double controlButtonContainerWidth = 60, double controlButtonContainerHeight = 60, double controlButtonIconSize = 30, Color controlButtonBackgroundColor = Colors.white, Color controlButtonIconColor = Colors.black, double controlButtonBorderRadius = 30, double bottomOverlayHeight = 40}) -
const
Properties
- autoStart → bool
-
final
- backgroundColor → Color
-
final
- bottomOverlayHeight → double
-
final
- controlButtonAlignment → Alignment
-
final
- controlButtonBackgroundColor → Color
-
final
- controlButtonBorderRadius → double
-
final
- controlButtonContainerHeight → double
-
final
- controlButtonContainerWidth → double
-
final
- controlButtonIconColor → Color
-
final
- controlButtonIconSize → double
-
final
- days → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hours → int
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- minutes → int
-
final
- months → int
-
final
-
onChangedTime
→ ValueChanged<
CountdownTime> ? -
Called whenever the remaining whole seconds change.
final
- onComplete → VoidCallback?
-
Called when the countdown completes.
final
-
onPause
→ ValueChanged<
CountdownTime> ? -
Called when the timer is paused.
final
-
onPlay
→ ValueChanged<
CountdownTime> ? -
Called when the timer is started/resumed.
final
- progressColor → Color
-
final
- progressGradient → Gradient?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seconds → int
-
final
- showControlButton → bool
-
final
- size → double
-
final
- strokeWidth → double
-
final
- textStyle → TextStyle
-
final
- weeks → int
-
final
- years → int
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _MyCircularCountdownTimerState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited