EfficientCircularCountdownTimer class

A highly efficient, customizable, and accessible circular countdown timer widget for Flutter.

Features:

  • Circular countdown and count-up modes
  • Customizable appearance (colors, gradients, stroke, text)
  • Controller for start, pause, resume, reset, and more
  • Callbacks for start, complete, and value changes
  • Optimized for performance and accessibility
Inheritance

Constructors

EfficientCircularCountdownTimer.new({Key? key, required int duration, int initialDuration = 0, bool isReverse = false, bool autoStart = true, double width = 100, double height = 100, Color? fillColor, Color? ringColor, Color? backgroundColor, Gradient? fillGradient, Gradient? ringGradient, Gradient? backgroundGradient, double strokeWidth = 8.0, StrokeCap strokeCap = StrokeCap.round, bool isReverseAnimation = false, bool isTimerTextShown = true, TextStyle? textStyle, TextAlign? textAlign, String timeFormatter(int seconds)?, CountdownController? controller, VoidCallback? onStart, VoidCallback? onComplete, ValueChanged<String>? onChange})
const

Properties

autoStart bool
If true, timer starts automatically when built.
final
backgroundColor Color?
Optional solid background color for the circle area.
final
backgroundGradient Gradient?
Optional gradient for the circle area (overrides backgroundColor).
final
controller CountdownController?
Controller for programmatic control.
final
duration int
Total duration of the timer, in seconds.
final
fillColor Color?
Color of the progress arc.
final
fillGradient Gradient?
Gradient for the progress arc (overrides fillColor).
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height of the timer widget.
final
initialDuration int
Initial value of the timer, in seconds.
final
isReverse bool
If true, timer counts down; otherwise, counts up.
final
isReverseAnimation bool
If true, the progress arc animates in reverse direction.
final
isTimerTextShown bool
If true, displays the timer text in the center.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChange ValueChanged<String>?
Callback when the timer value changes.
final
onComplete VoidCallback?
Callback when the timer completes.
final
onStart VoidCallback?
Callback when the timer starts.
final
ringColor Color?
Color of the background ring.
final
ringGradient Gradient?
Gradient for the background ring (overrides ringColor).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strokeCap StrokeCap
Style of the start/end points of the progress arc.
final
strokeWidth double
Thickness of the progress and background rings.
final
textAlign TextAlign?
Text alignment for the timer text.
final
textStyle TextStyle?
Text style for the timer text.
final
timeFormatter String Function(int seconds)?
Custom formatter for the timer text.
final
width double
Width of the timer widget.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<EfficientCircularCountdownTimer>
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