NyScheduler class
Nylo's Scheduler class This class is used to schedule tasks to run at a later time.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
clearTaskOnce(
String name) → Future< void> -
Clear the executed state for a task scheduled with taskOnce.
After calling this, the next taskOnce invocation with the same
namewill execute the callback again. -
getKeyTaskOnce(
String name) → String - Get the full storage key for a task that runs once. Use this with NyStorage.delete to reset the task.
-
hasExecutedTaskOnce(
String name) → Future< bool> - Check if a task has been executed
-
key(
String name) → String - The secure storage key
-
readBool(
String name) → Future< bool> -
Read a boolean value from the local storage
Provide a
namefor the value you want to read. -
readValue(
String name) → Future< String?> -
Read a value from the local storage
Provide a
namefor the value you want to read. -
taskDaily(
String name, dynamic callback(), {DateTime? endAt}) → Future< void> -
Run a task daily
Provide a
namefor the function and acallbackto execute. The function will execute every day. You can also provide anendAtdate to stop the task from running. You can also provide afrequencyto run the task weekly, monthly or yearly. Example: -
taskOnce(
String name, dynamic callback()) → Future< void> -
Run a function once
Provide a
namefor the function and acallbackto execute. The function will only execute once. -
taskOnceAfterDate(
String name, dynamic callback(), {required DateTime date}) → Future< void> -
Run a task after date
Provide a
namefor the function and acallbackto execute. The function will execute after thedateprovided. Example: -
writeBool(
String name, bool value) → Future -
Write a bool value to the local storage
Provide a
namefor the value and avalueto write. -
writeValue(
String name, String value) → Future -
Write a value to the local storage
Provide a
namefor the value and avalueto write.