cancel method

Future<void> cancel()

Cancels the reader.

Returns a future that completes when the reader is successfully canceled.

Implementation

Future<void> cancel() async {
  _isCanceled = true;
  await _subscription?.cancel();
  _subscription = null;
}