Use when working with Flutter Bloc/Cubit state management. Covers when to choose Bloc vs Cubit, how to use bloc and flutter_bloc together, lifecycle, testing, and safe defaults.
66
81%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill when building Flutter state management with bloc and flutter_bloc.
Cubit for simple, direct state updates.Bloc for event-driven flows, transitions, and replayable business logic.bloc in Dart-only projects.flutter_bloc in Flutter apps when you need widgets like BlocProvider, BlocBuilder, or BlocListener.flutter_bloc, you do not need to add bloc separately in a Flutter app because flutter_bloc depends on it.Choose Cubit when:
Choose Bloc when:
For Dart-only code:
blocflutter_bloc unless Flutter widgets are neededFor Flutter UI code:
flutter_blocbloc transitivelyBlocProvider at the feature boundaryBlocBuilder for rebuilds and BlocListener for side effectsPrefer this structure:
Keep state immutable.
Keep events explicit when using Bloc.
Keep one bloc or cubit per feature responsibility.
close().BlocProvider.BlocProvider or MultiBlocProvider to let Flutter manage disposal.new or a constructor outside the widget tree, you own its lifecycle.Use BlocBuilder when the widget should rebuild from state.
Use BlocListener when the widget should react without rebuilding.
Use BlocConsumer only when both are needed in one place.
Use buildWhen and listenWhen when rebuilds or listeners need narrowing.
Use BlocSelector when only one field should drive rebuilds.
Cubit by calling methods and asserting emitted states.Bloc by adding events and asserting the transition sequence.Bloc for trivial local state.bloc and flutter_bloc in a Flutter app when only flutter_bloc is needed.close() for manually managed instances.When writing code or advising on design:
bloc or flutter_blocbloc = core logic packageflutter_bloc = Flutter UI integration packageCubit = method-based updatesBloc = event-based transitionsclose()close()67dcbeb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.