setError method
Called by blocs (subclasses) when an error occurs
isBusy is cleared whenever an error
is set
Optional argument event
is the name of event which is calling setError
Implementation
@protected
void setError(StateError error, {String? event}) {
if (_error == error) return;
_monitor.onError(runtimeType.toString(), error, event: event);
_isBusy = false;
_error = error;
_stream?.add(null);
}