ScheduledTask class

A scheduled task that can be executed at specified intervals

Constructors

ScheduledTask({required String name, required Duration interval, required ScheduledJob job, String timeZone = 'UTC', bool retryOnFail = false, bool runOnce = false, int maxRetries = 3})
Creates a new scheduled task
ScheduledTask.fromConfig(Map<String, dynamic> config)
Creates a scheduled task from a configuration map
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
interval Duration
The interval at which the task should run
final
job ScheduledJob
The job to execute
final
maxRetries int
The maximum number of retries on failure
final
name String
The name of the task
final
retryOnFail bool
Whether to retry the task on failure
final
runOnce bool
Whether the task should only run once
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stats TaskStats
Get the current statistics for this task
no setter
timer Timer?
The timer that schedules the task
getter/setter pair
timeZone String
The timezone in which the task should run
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → void
Pauses the task
resume(dynamic scheduleNext(Duration)) → void
Resumes a paused task
run(dynamic scheduleNext(Duration)) Future<void>
Runs the task
start(dynamic scheduleNext(Duration)) → void
Starts the task
stop() → void
Stops the task
toString() String
A string representation of this object.
inherited

Operators

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