CustomTimerController class
Constructors
-
CustomTimerController({required TickerProvider vsync, required Duration begin, required Duration end, CustomTimerState initialState = CustomTimerState.reset, CustomTimerInterval interval = CustomTimerInterval.milliseconds})
-
Controls the state of the timer.
Allows you to execute the
start()
, pause()
, reset()
and finish()
functions. It also allows you to get or subscribe to the current state
and remaining
time.
Remember to dispose when you are no longer using it.
Methods
-
add(Duration duration)
→ void
-
Function to increase the remaining time.
-
addListener(VoidCallback listener)
→ void
-
Register a closure to be called when the object changes.
inherited
-
dispose()
→ void
-
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
finish()
→ void
-
Timer finish function.
-
jumpTo(Duration duration)
→ void
-
Function to move the current time.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners()
→ void
-
Call all the registered listeners.
inherited
-
pause()
→ void
-
Timer pause function.
-
removeListener(VoidCallback listener)
→ void
-
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset()
→ void
-
Timer reset function.
-
start()
→ void
-
Timer start function.
-
subtract(Duration duration)
→ void
-
Function to decrease the remaining time.
-
toString()
→ String
-
A string representation of this object.
inherited