Open Source · 2021
bloc_small
Flutter package that trims the BLoC pattern down to what an app actually needs — dependency injection, loading and error state, and RxDart stream helpers.
- Project Year
- 2021
- Android Downloads
- Not publicly disclosed
- iOS Downloads
- Not publicly disclosed
- Public Links
- 2
The problem
flutter_bloc gives a sound pattern and leaves the wiring to every project — dependency injection, loading overlays, try/catch around async work and the immutable-state boilerplate get rewritten app after app.
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 rather than leaving each async call to guard itself.
- 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