In short.
The Bloc skill is a written guide for AI assistants helping Flutter developers manage app state, but its examples need project-specific work before adoption. It provides concrete conventions for Cubit and Bloc, immutable states, repository injection, widget integration and tests. Its nullable-field copyWith example cannot clear existing values, and the supplied tests cover only basic login paths. Supported assistants, dependency versions and execution results are unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage comprises skills/bloc/SKILL.md, the only selected file listed for skills/bloc, plus the related repository-root LICENSE at revision ced864ab5189956dbf719a84011c24d860092116. Other repository skills, external package implementations and linked documentation are outside this scope. No code was executed; compilation, runtime behavior, assistant integration and generated-code quality remain unverified.
The overview
Identity
This resource is the bloc skill in evanca/flutter-ai-rules, specifically skills/bloc/SKILL.md. Its front matter names it bloc and describes tasks involving Cubit, Bloc, state modeling, Flutter widgets and tests. It supplies instructions and examples; the bloc and flutter_bloc libraries are separate dependencies.
The original folder address is [https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc]. The supplied snapshot is pinned to revision ced864ab5189956dbf719a84011c24d860092116.
Assessment
The strongest use is giving an assistant concrete conventions for a Flutter project that uses Bloc. The guidance connects architecture, state representation, UI behavior and testing, making it more useful than a short list of style preferences.
Adoption needs review of the sample code and agreement with the project's conventions. The login state example retains nullable values when callers pass null, which prevents explicit clearing of an old user or error message. No execution results establish correctness or an improvement in assistant output.
Users
It suits Flutter developers asking an assistant to create or refactor Cubits and Blocs, connect them to widgets, or draft unit tests. Experienced teams can use its explicit naming and layering conventions as a starting point for their own rules.
Beginners receive examples and explanations of when to choose different patterns, but still need familiarity with Dart classes, asynchronous methods, repositories and Flutter's widget tree. The examples assume application-specific types such as User and AuthRepository.
Capabilities
The skill explains when to use Cubit or event-driven Bloc, how to name events and states, and how to choose sealed state subclasses or a shared state class with a status enum. It also addresses Equatable equality, immutable updates and duplicate emissions.
Additional guidance covers repository injection, separation of presentation and business logic, BlocObserver, providers, builders, listeners and selectors. Test examples use bloc_test and mocktail. Debounce and throttle are mentioned as reasons to use event transformers, but transformer implementations are not supplied.
Using it
Requirements
Applying the examples requires a Flutter/Dart project with the relevant bloc and flutter_bloc dependencies. State examples use Equatable and @immutable; testing examples use bloc_test, mocktail and test. Application repositories, domain types and fixtures must be provided.
The file uses sealed classes and pattern matching, but specifies no minimum Dart, Flutter or package versions. It names no required AI model, supported assistant or skill-loading interface.
Mechanism
The file combines a task description, natural-language rules, decision tables and Dart snippets. A compatible assistant can use this material as context when producing or reviewing code; assistant adherence is unverified.
Its architecture routes widget input through a Cubit or Bloc to a repository, which wraps data providers. State changes drive UI rebuilding, while listeners handle effects such as navigation and snackbars. The skill itself supplies no runtime engine or automated enforcement.
Setup
Obtain the pinned SKILL.md and retain its MIT notice. Add the instructions through the documented mechanism of your chosen assistant, then align their conventions with the existing application. The supplied file does not establish an installation command, supported host list or required installation path.
Before adopting snippets, resolve compatible dependency versions, supply the missing application types and review state-reset behavior. The captured skill is available at [https://raw.githubusercontent.com/evanca/flutter-ai-rules/ced864ab5189956dbf719a84011c24d860092116/skills/bloc/SKILL.md].
Example
For a login feature, the skill demonstrates a LoginCubit receiving AuthRepository through its constructor. Calling login emits a loading state, awaits the repository, then emits success with a user or failure with an error message. Widget examples connect these states to loading indicators, screens and snackbars.
Its copyWith implementation uses incomingValue ?? existingValue for nullable fields. After a failure, a later successful login can retain the previous error message; passing null cannot clear it. An application would need explicit reset semantics and tests for repeated attempts. This behavior follows from the supplied code; no execution was performed.
Assessment & evidence
Limitations
The snippets are not a complete application. They omit definitions such as User, AuthRepository and fakeUser, and provide no dependency constraints. The illustrated tests cover initial state and individual success and failure paths; they do not demonstrate repeated attempts, nullable-field clearing, overlapping calls or widget integration.
Some rules are broad conventions, including defaulting to Cubit, requiring Equatable and forbidding direct bloc-to-bloc communication. Their fit with a particular architecture needs judgment. Compilation, runtime behavior, package compatibility and assistant output quality are unverified.
Design rationale
The skill recommends Cubit for simpler flows because callers can invoke methods directly. It recommends Bloc when explicit events, event traceability or advanced event processing are needed.
Its state-modeling tradeoff is similarly concrete: sealed subclasses represent mutually exclusive states with different data, while a status enum keeps shared fields together and can retain earlier data after failure. That flexibility makes explicit clearing behavior important, as the login example illustrates.
Alternatives
Developers seeking library reference material can follow the upstream Bloc repository [https://github.com/felangel/bloc] and the package pages [https://pub.dev/packages/bloc] and [https://pub.dev/packages/flutter_bloc], all linked by the skill. Their current contents and compatibility are not assessed here.
Within this resource, the main choices are Cubit versus Bloc and sealed state subclasses versus a status enum. The supplied material does not support a comparison with other state-management frameworks or competing assistant skills.
Evidence
The supplied source contains the complete selected skills/bloc/SKILL.md and the repository-root LICENSE. The pinned skill source is [https://raw.githubusercontent.com/evanca/flutter-ai-rules/ced864ab5189956dbf719a84011c24d860092116/skills/bloc/SKILL.md].
The accompanying licence source is [https://raw.githubusercontent.com/evanca/flutter-ai-rules/ced864ab5189956dbf719a84011c24d860092116/LICENSE]. These files establish the written guidance, examples and redistribution terms. They provide no benchmark, passing test output or evidence of an assistant using the skill successfully.
Access & freshness
Costs
The MIT notice grants permission to use and redistribute the material free of charge, subject to its notice requirements. The skill provides no assistant subscription prices, token-use measurements or implementation and maintenance estimates. Any costs associated with the chosen assistant and development setup remain unknown.
Rights
SKILL.md declares MIT, and the repository-root LICENSE carries Copyright (c) 2025 Ivanna. The notice permits use, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions.
The licence supplies the material without warranty and limits liability. These notices cover the supplied resource; licences for external dependencies are not established by these files.
Freshness
The supplied snapshot was captured on 2026-11-16 at 01:50:03.935 UTC from revision ced864ab5189956dbf719a84011c24d860092116. Findings apply to that revision; the main-branch folder address may later contain different material.
No skill release number, last-edit date or dependency compatibility range is provided. The 2025 copyright year does not establish when the skill was last changed.
Next steps
Start with one bounded feature whose state-management requirements are understood. Decide whether the skill's Cubit default, naming rules and repository boundaries fit the project, and confirm how your assistant loads the file.
Before adopting generated code, establish dependency versions, replace placeholder types, implement explicit clearing of nullable state and add tests for retries and overlapping operations where relevant. Check UI handling for initial, loading, success and failure states, and preserve the MIT notices when sharing the material.
