Open Source · 2021
bloc_small
Flutter package that trims the BLoC pattern down to dependency injection, loading and error state, and RxDart stream helpers.
- Project Year
- 2021
- Public Links
- 2
The problem
flutter_bloc provides a solid pattern, though every project ends up rewriting the same wiring for dependency injection, loading overlays, async error handling, and immutable state.
Solution approach
- Wrapped the pattern in MainBloc and MainCubit with GetIt injection and a CommonBloc registered automatically, so a new screen starts with the plumbing already done.
- Folded loading and error handling into blocCatch and cubitCatch so individual async calls stay concise.
- Exposed ReactiveSubject over RxDart for map, switchMap, and debounceTime, and integrated Freezed for immutable state and auto_route for type-safe navigation.
The outcome
- Published on pub.dev since August 2021 and maintained through 23 releases to 5.0.0, scoring the full 160/160 pub points.
- Used as the state layer of the Flutter starter template, so the package and the projects built on it are exercised against each other.
Tech stack
FlutterDartflutter_blocGetItRxDartFreezed