LiteTimerController class

Inheritance

Constructors

LiteTimerController.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
isLoading bool
no setterinherited
isLocalStorageInitialized bool
no setterinherited
preserveLocalStorageOnControllerDispose bool
preserveLocalStorageOnControllerDispose if true, the values you saved using setPersistentValue will be preserved despite of the controller's lifecycle
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useLocalStorage bool
useLocalStorage whether to use a local storage (based on Hive or not)
finalinherited

Methods

clearPersistentData({bool forceReBuild = false, bool forceClearLocalStorage = false}) Future
forceReBuild if true, it will call rebuild() after the data is cleared. forceClearLocalStorage makes sense only if you set preserveLocalStorageOnControllerDispose to true for your controller. This flag will clear your local storage
inherited
delay(int millis) Future
It's just a utility method in case you need to simulate some loading or just wait for something
inherited
getIsActiveState({required String timerName, required String groupName}) bool
getIsLoading(String? loaderName) bool
inherited
getNumSecondsLeftByName({required String timerName, required String groupName}) int
getPersistentValue<TType>(String key) → TType?
Retrieves a persistent data stored in SharedPreferences You can use your own types here but in this case you need to add json encoders / revivers so that jsonEncode / jsonDecode could understand how to work with your type
inherited
isActive(TimerData value) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numSecondsLeft(TimerData timerData) int
onLocalStorageInitialized() → void
called when the local storage has loaded all stored values. Override it if you need to get some values from local storage
override
onTimer(TimerData value) → void
rebuild() → void
inherited
reset() → void
override
resetTimer({required TimerData timerData, int? numSeconds, bool forceStart = false}) Future
resetTimerByName({required String timerName, required String groupName, int? numSeconds, bool forceStart = false}) Future
setIsLoading(String? loaderName, bool value) → void
inherited
setPersistentValue<TType>(String key, TType? value) Future
inherited
startLoading() → void
inherited
startTimerByName({required String timerName, required String groupName}) Future
stopAllLoadings() → void
just sets all loader flags to false but doesn't actually stop any loaders
inherited
stopLoading() → void
inherited
toString() String
A string representation of this object.
inherited
tryActivateTimer(TimerData timerData) Future
tryStartTimer({required String timerName, required String groupName, required int seconds, required bool autostart}) TimerData

Operators

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