Task<T> class

Used to create a task to run in another isolate.

Constructors

Task(TaskActionCallback<T> action, {TaskOnErrorCallback? onError, TaskOnDoneCallback<T>? onDone, TaskType type = TaskType.oneShot})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status TaskStatus
Current status of task.
no setter

Methods

dispose() Future<void>
Disposes task.
initialize() Future<void>
Initializes task.
kill() Future<void>
Kills task.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
Pauses task.
result() Future<T>
Return result of task.
resume() Future<void>
Resumes task.
start({Map<String, dynamic>? data, void onError(TaskError)?}) Future<void>
Starts the execution of a task.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

run<T>(TaskActionCallback<T> action, {TaskOnErrorCallback? onError, TaskOnDoneCallback<T>? onDone, Map<String, dynamic>? data, TaskType type = TaskType.oneShot}) Future<Task<T>>
Creates task.