flutter-bloc

Implement and test Flutter BLoC and Cubit state management patterns.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/ElbertePlinio/dotfiles --skill flutter-bloc-elberteplinio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-bloc
Source: https://github.com/ElbertePlinio/dotfiles/tree/main/private_dot_factory/skills/flutter-bloc
Command: npx skills add https://github.com/ElbertePlinio/dotfiles --skill flutter-bloc-elberteplinio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the common pitfalls of messy, hard-to-test Flutter state management when using BLoC or Cubit, avoiding issues like boolean soup states, scattered side effects, and unnecessary UI widget rebuilds.

Core Features & Use Cases

  • Pattern Selection Guidance: Clear decision rules to choose between local UI state, Cubit for simple feature logic, and BLoC for complex event-driven flows.
  • Implementation Best Practices: Enforces immutable states, user-intent focused events, proper side effect isolation, and narrow widget rebuilds via BlocSelector or buildWhen.
  • Testing Scaffolding: Structured output for state models, event flows, and bloc_test coverage for success, failure, loading, and concurrency scenarios.
  • Use Case: When building a new multi-step checkout flow in a Flutter e-commerce app, use this Skill to select the appropriate BLoC pattern, define the state and event models, and generate test cases for all flow edge cases.

Quick Start

Use the flutter-bloc skill to design the state management structure for your Flutter app's new user profile editing feature, including the appropriate Cubit or BLoC implementation and corresponding test cases.

Frequently Asked Questions about flutter-bloc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Flutter BLoC state and events to avoid boolean soup and unnecessary widget rebuilds?

To structure Flutter BLoC properly, enforce immutable state models and user-intent focused events. This isolates side effects and limits UI rebuilds by using BlocSelector or buildWhen to ensure only necessary widgets update.

When should I use Cubit versus BLoC for Flutter state management?

Choose Cubit for simple feature logic and BLoC for complex event-driven flows. This decision rule prevents over-engineering simple UI state while ensuring complex multi-step processes have the necessary event traceability.

How do I write bloc_test coverage for loading, success, and failure scenarios in Flutter?

Writing bloc_test coverage requires scaffolding state models and event flows to test success, failure, loading, and concurrency scenarios. This approach ensures your Flutter state logic handles all edge cases predictably.

Can I use this approach to refactor existing Flutter state management logic that has scattered side effects?

Yes, refactoring Flutter state management with this approach isolates side effects and enforces focused user-intent events. It transforms hard-to-maintain BLoC or Cubit implementations into structured, testable logic.

What is the best way to manage state in a multi-step Flutter checkout flow?

The best way to manage state in a multi-step Flutter checkout flow is implementing BLoC patterns with immutable states. This handles complex event-driven transitions and generates test cases for all flow edge cases.