cancel method

void cancel([
  1. String? msg
])

cancel operation

Implementation

void cancel([String? msg]) {
  _cancelError = OperationCanceledError(msg ?? 'cancel this token');
  if (_completers.isNotEmpty) {
    _completers
        // ignore: avoid_function_literals_in_foreach_calls
        .forEach((Completer<dynamic> e) => e.completeError(cancelError!));
  }
}