dispose method Null safety
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();
}