What problem does it solve?
Building a new Bloc feature often turns into inconsistent file layouts, incomplete state handling, and subtle concurrency bugs that only show up under real user interaction.
Core Features & Use Cases
- Canonical event/state/bloc trio: Generates the standard
<feature>_event.dart, <feature>_state.dart, and <feature>_bloc.dart structure so repositories are called only from the Bloc.
- Exhaustive sealed states with Freezed: Encourages
freezed sealed unions (e.g., Initial, Loading, Loaded, Failure) to make UI switch rendering compile-time exhaustive.
- Correct
bloc_concurrency transformer choices: Helps decide between droppable(), restartable(), sequential(), and concurrent() based on the semantics of each event handler.
- Precision UI wiring: Uses
BlocBuilder for rebuilds, BlocSelector for fine-grained updates, and BlocListener for side effects like navigation and snackbars.
- Optional persistence guidance: Explains when to use
HydratedBloc and how to implement JSON serialization and stable storagePrefix safely.
Quick Start
Ask the skill to scaffold a new feature called “cart”, including the event/state/bloc trio with freezed sealed states and the correct bloc_concurrency transformers for each handler.