TimerProvider class Null safety
A provider which periodically notifyListeners every set duration.
- Inheritance
- Object
- ChangeNotifier
- TimerProvider
Constructors
- TimerProvider({required Duration duration})
- Initialises timer with a Timer.periodic with interval of duration.
Properties
- duration ↔ Duration
-
The duration of the timer interval.
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- hasListeners → bool
-
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- timer ↔ Timer?
-
The Timer.periodic which notifyListeners.
read / write
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes. [...]
inherited
-
dispose(
) → void -
Stop the timer when this instance is dispose of.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
notifyListeners(
) → void -
Call all the registered listeners. [...]
@protected, @visibleForTesting, inherited
-
onTimerCallback(
Timer timer) → void -
Called every time the
timer
duration is reached. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes. [...]
inherited
-
stopTimer(
) → void - Stops the timer.
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited