CancellationToken class

Constructors

CancellationToken([Exception? _cancelException])

Properties

cancellationRequested bool
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(Function listener) Object
Attaches a function that will be called when the CancellationToken is canceled.
cancel() → void
Notifies listeners about the requested cancellation.
detach(Object key) → void
Detaches a function from the CancellationToken so it will not be called any more.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
throwIfCanceled() → void
Throws the defined exception or CanceledException if no custom exception is defined in the default constructor, when cancellation has been requested earlier by calling cancel().
toString() String
A string representation of this object.
inherited

Operators

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