CancelToken class

You can cancel a request by using a cancel token. One token can be shared with different requests. when a token's cancel method invoked, all requests with this token will be cancelled.

Constructors

CancelToken()

Properties

cancelError DioError
If request have been canceled, save the cancel Error.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isCancelled bool
whether cancelled
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
whenCancel Future<void>
When cancelled, this future will be resolved.
read-only

Methods

cancel([dynamic reason]) → void
Cancel the request
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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

Static Methods

isCancel(DioError e) bool
Whether is throw by cancel