TaskStatus enum

Defines a set of possible states which a Task can be in.

Inheritance

Constructors

TaskStatus()
const

Values

enqueued → const TaskStatus

Task is enqueued on the native platform and waiting to start

It may wait for resources, or for an appropriate network to become available before starting the actual download and changing state to running.

running → const TaskStatus

Task is running, i.e. actively downloading

complete → const TaskStatus

Task has completed successfully

This is a final state

notFound → const TaskStatus

Task has completed because the url was not found (Http status code 404)

This is a final state

failed → const TaskStatus

Task has failed due to an exception

This is a final state

canceled → const TaskStatus

Task has been canceled by the user or the system

This is a final state

waitingToRetry → const TaskStatus

Task failed, and is now waiting to retry

The task is held in this state until the exponential backoff time for this retry has passed, and will then be rescheduled on the native platform, switching state to enqueued and then running

paused → const TaskStatus

Task is in paused state and may be able to resume

To resume a paused Task, call resumeTaskWithId. If the resume is possible, status will change to TaskStatus.running and continue from there. If resume fails (e.g. because the temp file with the partial download has been deleted by the operating system) status will switch to TaskStatus.failed

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
isFinalState bool
True if this state is one of the 'final' states, meaning no more state changes are possible
no setter
isNotFinalState bool
True if this state is not a 'final' state, meaning more state changes are possible
no setter
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

Constants

values → const List<TaskStatus>
A constant List of the values in this enum, in order of their declaration.