cancel method

void cancel([
  1. Object? reason
])

Cancel the context

Implementation

void cancel([Object? reason]) {
  if (!_completer.isCompleted) {
    _completer.completeError(reason ?? 'Context cancelled');
  }
}