What problem does it solve?
This Skill addresses the complexity of managing state in Flutter applications, providing standardized patterns and reusable components for efficient development and maintainability.
Core Features & Use Cases
- Standardized State Management: Implements
AsyncCubit for API calls and AsyncState for managing loading, success, and error states.
- Efficient UI Updates: Utilizes
AsyncBlocBuilder and AsyncSliverBlocBuilder for seamless UI rendering based on state changes.
- Local Data Manipulation: Enforces non-negotiable rules for local state updates after CRUD operations to prevent unnecessary data refetches.
- Action Handling: Employs
BlocListener for managing side effects like showing snackbars or navigation.
- Pagination: Integrates
PaginatedCubit and PaginatedListWidget for handling infinite scrolling lists.
- Use Case: Develop a product listing screen where data is fetched asynchronously, with clear loading, error, and empty states, and where adding or deleting a product updates the list instantly without a full refresh.
Quick Start
Use the bloc-patterns skill to create a new cubit for fetching products that extends AsyncCubit and handles loading, success, and error states.