CustomTimerController class

Inheritance

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.

Properties

begin Duration
getter/setter pair
end Duration
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
initialState CustomTimerState
Defines the initial state of the timer. By default it is CustomTimerState.reset.
final
interval CustomTimerInterval
The update interval of the timer. By default it is CustomTimerUpdateInterval.milliseconds.
getter/setter pair
remaining ValueNotifier<CustomTimerRemainingTime>
Current remaining time.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ValueNotifier<CustomTimerState>
Current state of the timer.
no setter
vsync TickerProvider
The TickerProvider for the current context.
final

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

Operators

operator ==(Object other) bool
The equality operator.
inherited