stop method
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();
}
}