Agent skill · Documentation

bloc

Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit and Bloc.

evancagithub.com/evancaGitHub ↗
claude-codecodexcursorwindsurfMIT
Install
npx skills add evanca/flutter-ai-rules --skill bloc --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 11 KB
Bundled scripts: none
Path: skills/bloc/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 604
Language: Shell

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Bloc Skill Design, implement, and test state management using the [bloc](https://pub.dev/packages/bloc) and [flutter_bloc](https://pub.dev/packages/flutter_bloc) libraries. ## When to Use Use this skill when: * Creating a new Cubit or Bloc for a feature. * Modeling state (choosing between sealed classes and a single state class with status enum). * Wiring `BlocBuilder`, `BlocListener`, `BlocConsumer`, or `BlocProvider` in the widget tree. * Writing unit tests for a Cubit or Bloc. * Deciding between Cubit and Bloc. * Refactoring existing state management to follow bloc conventions. --- ## 1. Cubit vs Bloc | Situation | Use | |---|---| | Simple state, no events needed | `Cubit` | | Complex flows, event traceability needed | `Bloc` | | Advanced event processing (debounce, throttle) | `Bloc` with event transformers | **Default to `Cubit`. Refactor to `Bloc` only when requirements grow.** --- ## 2. Naming Conventions ### Events (Bloc only) - Named in **past tense**: `LoginButtonPressed`, `UserProfileLoaded`. - Format: `BlocSubject` + optional noun + verb. - Initial load event: `BlocSubjectStarted` (e.g., `AuthenticationStarted`). - Base event class: `BlocSubjectEvent`. ### States - Na

What's inside
Steps it walks through
  1. When to Use
  2. 1. Cubit vs Bloc
  3. 2. Naming Conventions
  4. Events (Bloc only)
  5. States
  6. 3. Modeling State
  7. When to use a sealed class with subclasses
  8. When to use a single class with a status enum
  9. State rules (both approaches)
  10. 4. Cubit Implementation
  11. 5. Bloc Implementation
  12. 6. Architecture
  13. 7. Flutter Bloc Widgets
  14. 8. Testing
More from flutter-ai-rules
All skills →
About this skill
What does the bloc skill do?

Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit and Bloc.

How do I install it?

Run `npx skills add evanca/flutter-ai-rules --skill bloc --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From evanca/flutter-ai-rules, a repository with 604 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going