whenCancelled property

Future<void> get whenCancelled

Future that completes when this token is cancelled

Implementation

Future<void> get whenCancelled {
  _completer ??= Completer<void>();
  if (isCancelled) {
    return Future.value();
  }
  return _completer!.future;
}