isCancelled property

bool isCancelled

Whether or not the operation has been cancelled.

Implementation

bool get isCancelled {
  // When a sync CancellableCompleter's future is wrapped with another
  // cancellable future (eg by using .asCancellable()), this getter may be
  // called while the cancellation token is still iterating through the
  // attached cancellables. To return an accurate result when onCancel()
  // hasn't been called yet, the cancellation state should be determined by
  // the currently attached token if there is one.
  return _attachedToken?.isCancelled ?? _isCancelled;
}