cancel method

Future<void> cancel()

The subscription was cancelled. A waiting yield wakes and unwinds; the returned future completes once the body has run its finally blocks, which is when Dart completes StreamSubscription.cancel().

Implementation

Future<void> cancel() {
  cancelled = true;
  resume();
  return _done.future;
}