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.
no setter
hashCode int
The hash code for this object.
no setterinherited
isCancelled bool
whether cancelled
no setter
requestOptions RequestOptions?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
whenCancel Future<DioError>
When cancelled, this future will be resolved.
no setter

Methods

cancel([dynamic reason]) → void
Cancel the request
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

Static Methods

isCancel(DioError e) bool
Whether is throw by cancel