CancellationToken class

A cancellation token that allows cancelling asynchronous operations.

Constructors

CancellationToken()

Properties

hashCode int
The hash code for this object.
no setterinherited
isCancelled bool
Returns true if cancellation has been requested.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(void listener()) → void
Registers a callback to be invoked when the token is cancelled. If the token is already cancelled, the callback is invoked immediately.
cancel() → void
Cancels the operation and notifies all registered listeners.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(void listener()) → void
Removes a previously registered callback.
toString() String
A string representation of this object.
inherited

Operators

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