AsyncTask<P, R> class Null safety

Base class for tasks implementation.

Available Extensions

Constructors

AsyncTask()

Properties

endTime DateTime?
The execution end time.
read-only
error → dynamic
The error, after the task execution is finished.
read-only
executionTime Duration?
read-only
executorThread AsyncExecutorThread?
read-only
hasError bool
Returns true if this task execution has finished with an error.
read-only
hashCode int
The hash code for this object.
read-only, inherited
initTime DateTime?
The execution initial time.
read-only
isFinished bool
Returns true if this task execution has finished.
read-only
isIdle bool
Returns true if this task has NOT yet been submitted.
read-only
isInExecutionContext bool
if true, indicates that the current context is inside AsyncTask.run.
read-only
isNotFinished bool
Returns true if this task execution has NOT finished.
read-only
isSuccessful bool
Returns true if this task execution has finished successfully.
read-only
result → R?
The result, after the task execution is finished.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
status AsyncTaskStatus
The current status.
read-only
submitTime DateTime?
The submit time.
read / write
taskType String
read-only
wasSubmitted bool
Returns true if this task has been submitted.
read-only

Methods

addOnFinishAsyncTask(OnFinishAsyncTask onFinishAsyncTask) → void
Adds a trigger to be called when this tasks finishes.
channel() FutureOr<AsyncTaskChannel?>
Returns an optional AsyncTaskChannel for communication with the task.
channelInstantiator() AsyncTaskChannel?
Instantiate the optional AsyncTaskChannel return by channel.
channelResolved() AsyncTaskChannel?
Returns an optional AsyncTaskChannel. If not resolved yet will return null.
copy() AsyncTask<P, R>
Creates a copy of this task in its initial state (before execution state).
execute() FutureOr<R>
Executes this tasks immediately.
instantiate(P parameters, [Map<String, SharedData>? sharedData]) AsyncTask<P, R>
Creates an instance of this task type with parameters and optional sharedData.
loadSharedData(String key, dynamic serial) SharedData?
Load of a SharedData serial for the corresponding key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
parameters() → P
The parameters of this tasks.
reset() → void
Resets this task to it's initial state, before any execution.
resolveChannel(void initializer(AsyncTask task, AsyncTaskChannel channel)) AsyncTaskChannel?
Resolves the channel instance. Called by AsyncExecutor when executing this task.
run() FutureOr<R>
Computes/runs this task.
sharedData() Map<String, SharedData>?
Returns an optional Map of SharedData, where each entry will be transferred to the executor thread/isolate only once.
toString() String
A string representation of this object.
override
waitResult() Future<R>
Returns a Future to wait for the task result.

Operators

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