dispose method Null safety

  1. @mustCallSuper
void dispose()

Closes the state and error streams and removes any listeners associated with those streams

Implementation

@mustCallSuper
void dispose() {
  for (var sub in _subscriptions) {
    sub.cancel();
  }
  _subscriptions.clear();
  _errorController.close();
  _stateController.close();
}