EasyTimerCount class
A customizable timer widget with support for start, stop, reset, resume, and restart.
Example usage:
EasyTimerCount(
duration: EasyTime(minutes: 1),
onTimerStarts: (context) => print("Timer started"),
onTimerEnds: (context) => print("Timer ended"),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- EasyTimerCount
Constructors
-
EasyTimerCount.new({Key? key, required EasyTime duration, required FutureOr<
void> onTimerStarts(BuildContext context), required FutureOr<void> onTimerEnds(BuildContext context), RankingType rankingType = RankingType.descending, SeparatorType? separatorType = SeparatorType.colon, bool resetTimer = false, Color? timerColor, FontWeight? timerTextWeight, double? fontSize, double? wordSpacing, double? letterSpacing, TextDecoration? decoration, Color? backgroundColor, TextDecorationStyle? textDecorationStyle, String? fontFamily, Locale? locale, TextOverflow? textOverflow, EasyTimerController? controller, bool reCountAfterFinishing = false, FutureOr<void> onTimerRestart(BuildContext context, int countOfRestart)?}) - Default constructor for EasyTimerCount.
-
EasyTimerCount.builder({Key? key, required EasyTime duration, required Widget builder(String time)?, required FutureOr<
void> onTimerStarts(BuildContext context), required FutureOr<void> onTimerEnds(BuildContext context), RankingType rankingType = RankingType.descending, SeparatorType? separatorType = SeparatorType.colon, bool resetTimer = false, EasyTimerController? controller, bool reCountAfterFinishing = false, FutureOr<void> onTimerRestart(BuildContext context, int countOfRestart)?}) - Builder constructor for EasyTimerCount to allow custom rendering.
Properties
- backgroundColor → Color?
-
Background color of the timer text.
final
- builder → Widget Function(String time)?
-
Custom builder to render the timer with a different widget instead of Text.
final
- controller → EasyTimerController?
-
Optional controller to manage the timer manually.
final
- decoration → TextDecoration?
-
Decoration applied to the timer text.
final
- duration → EasyTime
-
The duration of the timer.
final
- fontFamily → String?
-
Font family of the timer text.
final
- fontSize → double?
-
Font size of the timer text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- letterSpacing → double?
-
Letter spacing of the timer text.
final
- locale → Locale?
-
Locale for text rendering.
final
-
onTimerEnds
→ FutureOr<
void> Function(BuildContext context) -
Callback triggered when the timer ends.
final
-
onTimerRestart
→ FutureOr<
void> Function(BuildContext context, int countOfRestart)? -
Callback triggered when the timer restarts (only if reCountAfterFinishing is true).
final
-
onTimerStarts
→ FutureOr<
void> Function(BuildContext context) -
Callback triggered when the timer starts.
final
- rankingType → RankingType
-
Whether the timer counts up (RankingType.ascending) or down (RankingType.descending).
final
- reCountAfterFinishing → bool
-
Whether the timer should automatically restart after finishing.
final
- resetTimer → bool
-
Whether the timer should reset after finishing.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separatorType → SeparatorType?
-
Type of separator between the displayed numbers.
final
- textDecorationStyle → TextDecorationStyle?
-
Decoration style of the timer text.
final
- textOverflow → TextOverflow?
-
Overflow behavior for the timer text.
final
- timerColor → Color?
-
Color of the timer text.
final
- timerTextWeight → FontWeight?
-
Font weight of the timer text.
final
- wordSpacing → double?
-
Word spacing of the timer text.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< EasyTimerCount> -
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