AnimatedCountdownTimer class
A widget that provides an animated countdown timer with customizable features.
The countdown can optionally show a custom text (doneText
) when it finishes.
You can configure colors, font sizes, and animation settings. Additionally,
onStart
and onDone
callbacks are available to track the timer’s lifecycle.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AnimatedCountdownTimer
Constructors
- AnimatedCountdownTimer({Key? key, int initialCount = 3, Color textColor = Colors.white, Color overlayColor = const Color.fromRGBO(0, 0, 0, 0.7), bool enableDoneText = true, double doneTextFontSize = 22, double numFontSize = 22, String doneText = "GO!", VoidCallback? onStart, VoidCallback? onDone, String fontFamily = "BungeeRegular"})
-
Constructor to create an AnimatedCountdownTimer with various customization options.
const
Properties
- doneText → String
-
Custom text to display when the countdown is complete.
final
- doneTextFontSize → double
-
Font size of the
doneText
.final - enableDoneText → bool
-
Whether to display the
doneText
after the countdown ends.final - fontFamily → String
-
Custom fonts for doneText and countdown number.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialCount → int
-
Initial countdown value (defaults to 3).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- numFontSize → double
-
Font size of the countdown numbers.
final
- onDone → VoidCallback?
-
Callback triggered when the countdown finishes.
final
- onStart → VoidCallback?
-
Callback triggered when the countdown starts.
final
- overlayColor → Color
-
Background overlay color during the countdown.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textColor → Color
-
Color of the countdown numbers.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _AnimatedCountdownTimerState -
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