stop method

void stop({
  1. bool closeController = false,
})

Cancel the subscription to stream, and reset the internal state. closeController if true, close the internal streamcontroller.

Implementation

void stop({bool closeController = false}) {
  logDebug('Stopped listening.');

  _subscription?.cancel();
  _subscription = null;
  _resetState();

  if (closeController && !_controller.isClosed) {
    _controller.close();
  }
}