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

isCanceled → bool
Whether this operation has been canceled before it completed.
read-only
isCompleted → bool
Whether this operation completed before being canceled.
read-only
value → Future<T>
The value returned by the operation.
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

asStream() → Stream<T>
Creates a Stream containing the result of this operation. [...]
cancel() → Future
Cancels this operation. [...]
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. [...]
valueOrCancellation([T cancellationValue ]) → Future<T>
Creates a Future that completes when this operation completes or when it's cancelled. [...]
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