Bloc
VeryGoodOpenSource/vgv-ai-flutter-plugin
Best practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with Equatable, the Page/View split with BlocProvider, BlocBuilder…
Helps choose between Bloc and Cubit in Flutter and sets defaults for packages, lifecycle, widget binding and tests.
$ npx skills add andrewyng/context-hub --skill bloc-cubit -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install andrewyng/context-hub bloc-cubit --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/andrewyng/context-hub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/content/flutter/skills/state-management/bloc-cubit .claude/skills/bloc-cubit && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bloc-cubit" agent skill from https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubit into .claude/skills/bloc-cubit/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc-cubit", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubitType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add andrewyng/context-hub --skill bloc-cubit -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install andrewyng/context-hub bloc-cubit --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andrewyng/context-hub.git skills-src && mkdir -p .agents/skills && cp -r skills-src/content/flutter/skills/state-management/bloc-cubit .agents/skills/bloc-cubit && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bloc-cubit" agent skill from https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubit into .agents/skills/bloc-cubit/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc-cubit", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add andrewyng/context-hub --skill bloc-cubit -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install andrewyng/context-hub bloc-cubit --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andrewyng/context-hub.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/content/flutter/skills/state-management/bloc-cubit .cursor/skills/bloc-cubit && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bloc-cubit" agent skill from https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubit into .cursor/skills/bloc-cubit/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc-cubit", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/andrewyng/context-hub.git --path content/flutter/skills/state-management/bloc-cubit--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add andrewyng/context-hub --skill bloc-cubit -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install andrewyng/context-hub bloc-cubit --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andrewyng/context-hub.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/content/flutter/skills/state-management/bloc-cubit .gemini/skills/bloc-cubit && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bloc-cubit" agent skill from https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubit into .gemini/skills/bloc-cubit/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc-cubit", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install andrewyng/context-hub bloc-cubitInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add andrewyng/context-hub --skill bloc-cubit -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/andrewyng/context-hub.git skills-src && mkdir -p .github/skills && cp -r skills-src/content/flutter/skills/state-management/bloc-cubit .github/skills/bloc-cubit && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bloc-cubit" agent skill from https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubit into .github/skills/bloc-cubit/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc-cubit", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add andrewyng/context-hub --skill bloc-cubit -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install andrewyng/context-hub bloc-cubit --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/andrewyng/context-hub.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/content/flutter/skills/state-management/bloc-cubit .opencode/skills/bloc-cubit && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bloc-cubit" agent skill from https://github.com/andrewyng/context-hub/tree/main/content/flutter/skills/state-management/bloc-cubit into .opencode/skills/bloc-cubit/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc-cubit", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bloc-cubitHelps choose between Bloc and Cubit in Flutter and sets defaults for packages, lifecycle, widget binding and tests.
The core rule is that Cubit suits simple, direct state updates, such as counters, toggles, filters, form flags and theme mode, while Bloc suits event-driven flows with explicit transitions, such as auth, pagination, checkout, sync and multi-step workflows. Dart-only projects add the bloc package, and Flutter apps add flutter_bloc, which brings bloc along, for BlocProvider, BlocBuilder and BlocListener.
The suggested structure keeps I/O in a repository or service, state and orchestration in the bloc or cubit, and only action dispatching and rendering in the UI, with immutable state, explicit events for Bloc and one bloc or cubit per feature responsibility. Blocs you create yourself must be closed with close(), while instances owned by BlocProvider must not be. BlocBuilder rebuilds, BlocListener reacts without rebuilding, BlocConsumer is for both, and buildWhen, listenWhen and BlocSelector narrow updates.
Cubits are tested by calling methods and asserting emitted states, and Blocs by adding events and asserting the transition sequence. The excerpt is cut off after the first testing rules.
Read from SKILL.md and the folder at commit 67dcbeb. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Flutter Bloc and Cubit loads about 998 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 509 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from andrewyng/context-hub at commit 67dcbeb, republished under its MIT licence (© andrewyng). 509 words, ~998 tokens.
.claude/skills/bloc-cubit/SKILL.md (or your agent's skills folder).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()© andrewyng, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in content/flutter/skills/state-management/bloc-cubit of andrewyng/context-hub.
Open the folder on GitHubat commit 67dcbeb
Flutter Bloc and Cubit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Flutter Bloc and Cubit this skillandrewyng/context-hub | 14k | — | ~998 | Automated safety check: Pass | MIT | |
| BlocVeryGoodOpenSource/vgv-ai-flutter-plugin | 170 | — | ~2k | Automated safety check: Pass | MIT | |
| Flutter Dart Code Reviewaffaan-m/ECC | 276k | 2 repos | ~5.8k | Automated safety check: Notes | MIT | |
| Signals for Flutterrodydavis/signals.dart | 819 | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Flutter ExpertFNOSP/FlyNarwhal | 509 | 2 repos | ~758 | Automated safety check: Pass | MIT | |
| Signals Core Advanced Primitivesrodydavis/signals.dart | 819 | — | ~1.7k | Automated safety check: Pass | Apache-2.0 |
VeryGoodOpenSource/vgv-ai-flutter-plugin
Best practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with Equatable, the Page/View split with BlocProvider, BlocBuilder…
affaan-m/ECC
Library-agnostic Flutter/Dart code review checklist covering widget best practices, state management patterns (BLoC, Riverpod, Provider, GetX, MobX, Signals), Dart idioms, performance…
rodydavis/signals.dart
Reference for the signals_flutter package: reactive signals, computed values, effects, async signals and collection signals bound to Flutter widgets.
FNOSP/FlyNarwhal
A skill your agent uses when building cross-platform applications with Flutter 3+ and Dart.
rodydavis/signals.dart
Reference for the advanced parts of Dart's signals_core: reactive primitives, async signals, reactive collections and utility types, with a linked page for each.
rohitg00/awesome-claude-code-toolkit
Mobile development patterns for React Native and Flutter including navigation, state management, and responsive design
andrewyng/context-hub
Fetches current documentation for third-party APIs and SDKs with the chub CLI before the agent writes code against them, instead of relying on remembered API shapes.
andrewyng/context-hub
Guides building Tavily integrations for web search, URL extraction, site crawling and AI-assisted research in Python or JavaScript agent and RAG projects.
andrewyng/context-hub
Sequences parts-mcp tool calls for finding, pricing and checking availability of electronic components, including BOM processing and datasheet navigation.
andrewyng/context-hub
Adds Olakai monitoring to an existing LLM application with minimal code changes, then configures custom KPIs so the dashboard tracks business outcomes instead of just token counts.
andrewyng/context-hub
Collects reusable Playwright patterns for logging in during end-to-end tests: password forms, OAuth redirects, saved browser state and TOTP two-factor codes.
andrewyng/context-hub
Builds a new AI agent with Olakai monitoring from the start: CLI login, SDK integration, per-agent KPI configuration and an end-to-end check that data flows.
Categories
Helps choose between Bloc and Cubit in Flutter and sets defaults for packages, lifecycle, widget binding and tests. The core rule is that Cubit suits simple, direct state updates, such as counters, toggles, filters, form flags and theme mode, while Bloc suits event-driven flows with explicit transitions, such as auth, pagination, checkout, sync and multi-step workflows. Dart-only projects add the bloc package, and Flutter apps add flutter_bloc, which brings bloc along, for BlocProvider, BlocBuilder and BlocListener.
Flutter Bloc and Cubit fits situations like: choosing between Bloc and Cubit for a Flutter feature; adding flutter_bloc to a Flutter app; deciding who is responsible for closing a bloc or cubit; writing tests for a Cubit or a Bloc.
Run `npx skills add andrewyng/context-hub --skill bloc-cubit -a claude-code`. Or copy the skill folder (content/flutter/skills/state-management/bloc-cubit in andrewyng/context-hub) into .claude/skills/bloc-cubit in your project. Claude Code loads it when a task matches its description.
Run `npx skills add andrewyng/context-hub --skill bloc-cubit -a codex`. Or copy the skill folder (content/flutter/skills/state-management/bloc-cubit in andrewyng/context-hub) into .agents/skills/bloc-cubit in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add andrewyng/context-hub --skill bloc-cubit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bloc-cubit, .gemini/skills/bloc-cubit, .github/skills/bloc-cubit and .opencode/skills/bloc-cubit in your project.
SKILL.md names no scripts, command-line tools or credentials: Flutter Bloc and Cubit is instructions for the agent only. Our summary lists: A Flutter or Dart project using the bloc or flutter_bloc package.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Flutter Bloc and Cubit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 998 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Flutter Bloc and Cubit: Bloc (VeryGoodOpenSource/vgv-ai-flutter-plugin, 170 stars), Flutter Dart Code Review (affaan-m/ECC, 276k stars), Signals for Flutter (rodydavis/signals.dart, 819 stars) and Flutter Expert (FNOSP/FlyNarwhal, 509 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
andrewyng (a GitHub user) maintains it in andrewyng/context-hub, which has 13,973 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on May 31, 2026.
Source: andrewyng/context-hub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.