onError method

void onError(
  1. Object error,
  2. StackTrace stacktrace

Called whenever an error is thrown within mapEventToState. By default all errors will be ignored and bloc functionality will be unaffected. The stacktrace argument may be null if the state stream received an error without a stacktrace. A great spot to handle errors at the individual Bloc level.


void onError(Object error, StackTrace stacktrace) => null;