TimerController class
A controller used to programmatically interact with a background timer.
This allows you to control the timer (pause, resume, reset) from outside the widget tree where the timer is defined.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- remainingSeconds → int
-
Returns the current number of seconds remaining in the countdown.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attach(
TimerCubit cubit) → void - Internal method used to link the TimerCubit to this controller.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void - Pauses the current timer and saves the progress to local storage.
-
reset(
int seconds) → void -
Resets the timer to a new
secondsduration and starts it immediately. -
resume(
) → void - Resumes the timer from the last saved state.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited