How to do error handling with bloc pattern in flutter?
This is how we handle it in my team: First we build our main page (The navigation root) like this: @override Widget build(BuildContext context) { return BlocBuilder<SuspectEvent, SuspectState>( bloc: _bloc, builder: (context, state) { if (state.cameras.isEmpty) _bloc.dispatch(GetCamerasEvent()); if (!_isExceptionHandled) { _shouldHandleException( hasException: state.hasException, handleException: state.handleException); } return Scaffold( … We declare the _shouldHandleException like this … Read more