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
isCancelled → bool
whether cancelled
read-only
whenCancel → Future<void>
When cancelled, this future will be resolved.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

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 ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

isCancel(DioError e) → bool
Whether is throw by cancel