cancel method

void cancel()

Requests cancellation of the associated operation.

Implementation

void cancel() {
  if (_isCancelled) return;
  _isCancelled = true;
  _controller.add(null);
}