CancelableOperation<T> class

An asynchronous operation that can be cancelled.

The value of this operation is exposed as value. When this operation is cancelled, value won't complete either successfully or with an error. If value has already completed, cancelling the operation does nothing.

Constructors

CancelableOperation.fromFuture(Future<T> inner, {FutureOr onCancel()})
Creates a CancelableOperation wrapping inner. [...]
factory

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
isCanceled bool
Whether this operation has been canceled before it completed.
read-only
isCompleted bool
Whether the CancelableCompleter backing this operation has been completed. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value Future<T>
The value returned by the operation.
read-only

Methods

asStream() Stream<T>
Creates a Stream containing the result of this operation. [...]
cancel() Future
Cancels this operation. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
then<R>(FutureOr<R> onValue(T), {FutureOr<R> onError(Object, StackTrace), FutureOr<R> onCancel(), bool propagateCancel: false}) CancelableOperation<R>
Registers callbacks to be called when this operation completes. [...]
toString() String
Returns a string representation of this object.
inherited
valueOrCancellation([T cancellationValue]) Future<T>
Creates a Future that completes when this operation completes or when it's cancelled. [...]

Operators

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