flutter-bloc
Installation
SKILL.md
BLoC Pattern
- Sealed States & Events: Always use
sealed classfor both States and Events to ensure exhaustive UI handling and compile-time safety. - Immutability: All States, Events, and Domain Entities MUST be immutable (using
finalandEquatableorfreezed). - Official BLoC Part-Part Of Pattern: Every
_bloc.dartfile MUST include its corresponding_event.dartand_state.dartfiles usingpartdirectives. Each event/state file MUST have apart ofdirective 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';