
This is a comprehensive BLoC implementation guide that enforces Flutter's state management best practices with strict architectural opinions. You get mandatory directory structures, the official part/part-of pattern for BLoCs, and clear rules about sealed classes for exhaustive state handling. It pushes injectable for DI, distinguishes when to use @injectable versus @lazySingleton, and bans business logic in widgets entirely. The workflow checklist is genuinely helpful for ensuring you hit loading states and avoid hardcoded values. If you're tired of inconsistent BLoC implementations across your team or want to stop debugging why someone passed a BLoC instance through GoRouter params, this codifies the guardrails. Opinionated, but that's the point.
$ npx -y skills add dhruvanbhalara/skills --skill flutter-bloc --agent claude-codeInstalls into .claude/skills of the current project.
sealed class for both States and Events to ensure exhaustive UI handling and compile-time safety.final and Equatable or freezed)._bloc.dart file MUST include its corresponding _event.dart and _state.dart files using part directives. Each event/state file MUST have a part of directive pointing back to the bloc file. This ensures a single library scope and shared private members.
// auth_bloc.dart
part 'auth_event.dart';
part 'auth_state.dart';
class AuthBloc extends Bloc<AuthEvent, AuthState> { ... }
// auth_event.dart
part of 'auth_bloc.dart';
Sponsors