CountDownTimeController class
This class is a ChangeNotifier that has a
start()
method that starts a timer that counts down from a given duration and notifies listeners when the timer is done
- Inheritance
-
- Object
- ChangeNotifier
- CountDownTimeController
Constructors
Properties
- currentTimerSeconds ↔ int
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isUnmounted ↔ bool
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timerInstance ↔ Timer?
-
getter/setter pair
- timeStartInSeconds ↔ int
-
getter/setter pair
Methods
-
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).
inherited
-
formatSecondsToTime(
int timeInSecond, int timeStartInSeconds) → String - It takes in two integers and returns a string.
-
getCurrentTimeInSeconds(
) → int -
getCurrentTimeInSeconds()
returns the current time in seconds -
getCurrentTimeInSecondsFormatted(
) → String - It returns the current time in seconds formatted.
-
maybeUpdateTimeStart(
covariant CountDownTime oldWidget) → void - If the timeStartInSeconds value has changed, reset the timer
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetTimer(
) → void -
setCurrentTimeInSeconds(
int value) → void - If the value is greater than or equal to 0, set the currentTimerSeconds to the value, otherwise set it to 0
-
setIsUnmounted(
bool unmounted) → void - Set if the widget is unmounted
-
setTimeStartInSeconds(
int value) → void - It sets the timeStartInSeconds variable to the value passed in.
-
startTimer(
int timerDefaultValue, [dynamic timeCallback(int)?]) → void - StartTimer takes an int and an optional function that takes an int and returns nothing, and returns nothing.
-
stopTimer(
) → void - If the timer instance is not null, cancel it
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited