원클릭으로
flutter-bloc
BLoC/Cubit state management for Flutter — naming, state modeling, widgets, testing, architecture rules.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
BLoC/Cubit state management for Flutter — naming, state modeling, widgets, testing, architecture rules.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
MCP server usage for Dart MCP, Firecrawl, Hugging Face. Tool priorities, commands, workflows.
Development process rules. Use when planning complex tasks, implementing incrementally, managing packages, or following communication guidelines.
Dart 3 patterns including switch/if-case, pattern matching, sealed classes, and records. Use when writing exhaustive switches, destructuring, pattern matching on types, or returning multiple values with records.
Core code quality rules for Dart/Flutter. Use when formatting, handling async/null safety, organizing classes, or following Dart best practices.
Code review checklist for PRs/MRs. Use when reviewing pull requests, examining code changes, or when the user asks for a code review.
Data handling patterns for Dart/Flutter. Use when implementing serialization, caching, layer separation, DTOs, repositories, offline-first, or data validation.
| name | flutter-bloc |
| description | BLoC/Cubit state management for Flutter — naming, state modeling, widgets, testing, architecture rules. |
BlocSubject + noun + verb — LoginButtonPressed, UserProfileLoadedBlocSubjectStartedBlocSubjectEventBlocSubject + Initial | Success | Failure | InProgressBlocSubjectState + BlocSubjectStatus enumBlocSubjectStateEquatable; annotate @immutable; implement copyWith; use const constructorsprops; copy List/Map with List.of/Map.of| Cubit | Bloc |
|---|---|
| Simple state, no events, less boilerplate | Complex event-driven logic, traceability |
Public methods return void/Future<void> | Trigger via add(); no custom public methods |
Start with Cubit; refactor to Bloc if needed.
emit() in try-catchemit inside Cubit/Bloc; never externallystate == nextState) are ignoredBlocObserver in main.dart| Widget | Purpose |
|---|---|
BlocBuilder | Rebuild on state changes (builder must be pure) |
BlocListener | Side effects only (navigation, dialogs) |
BlocConsumer | Builder + listener combined |
BlocSelector | Rebuild only on selected state slice |
BlocProvider / MultiBlocProvider | Provide blocs to subtree |
RepositoryProvider / MultiRepositoryProvider | Provide repos to subtree |
Context access:
context.read<T>() — one-off, no rebuild (callbacks)context.watch<T>() — subscribe and rebuild (inside build)context.select<T, R>() — rebuild on specific slicePrefer BlocBuilder/BlocSelector over context.watch/context.select for explicit scoping. Handle all states in UI: empty, loading, error, populated.
BlocListener to listen to one and add events to anotherblocTest<CounterCubit, CounterState>(
'emits [1] when increment is called',
build: () => CounterCubit(),
act: (cubit) => cubit.increment(),
expect: () => [const CounterState(1)],
);
bloc_test for state transitions; bloc_lint in CI