flutter-state-management

Organize and refactor Flutter state management into feature-first architecture.

1|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Tututuzzzzzz/Social-Network-FE --skill flutter-state-management-tututuzzzzzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-state-management
Source: https://github.com/Tututuzzzzzz/Social-Network-FE/tree/main/.agents/skills/flutter-state-management
Command: npx skills add https://github.com/Tututuzzzzzz/Social-Network-FE --skill flutter-state-management-tututuzzzzzz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Thiết kế và refactor state management cho frontend Flutter trong repository này. Luôn dùng skill này khi user yêu cầu tạo state management, dùng Riverpod, dùng Bloc/Cubit, quản lý trạng thái màn hình, loading/error/success state, refactor setState, tách logic khỏi widget, quản lý auth state, hoặc quản lý feed/post/comment state.

Core Features & Use Cases

  • Viết và tổ chức state management theo mô hình Bloc/Cubit (hoặc chuyển dần sang Riverpod theo yêu cầu)
  • Quản lý trạng thái màn hình với loading, error, data rõ ràng
  • Tách logic khỏi widget để tăng tính testable và bảo trì
  • Hỗ trợ DI và cấu hình route theo kiến trúc hiện có
  • Áp dụng theo structure feature-first: auth, chat, friend, home, post, profile, reels

Quick Start

Thiết lập và refactor state management cho Flutter theo cấu trúc hiện có, ưu tiên Bloc/Cubit và Riverpod khi được yêu cầu.

Frequently Asked Questions about flutter-state-management

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

FAQPage Schema
How do I refactor Flutter state management to separate UI logic from widgets?

Manage Flutter screen state by implementing immutable states with clear loading, error, and success conditions using Bloc, Cubit, or Riverpod. This approach separates UI rendering from business logic and ensures consistent state handling across features.

Can I migrate legacy ChangeNotifier and Provider code to Riverpod in an existing Flutter app?

Yes, you can migrate legacy ChangeNotifier and Provider implementations to Riverpod. The process aligns state management with feature-first architecture, applying immutable states, clear domain separation, and consistent dependency injection and routing integration.

What is the best way to organize Flutter state management for feature-first architectures?

Organize Flutter state management by structuring Bloc, Cubit, or Riverpod implementations around specific features like auth, chat, home, post, profile, and reels. This feature-first structure enforces stable design principles with clear UI, state, domain, and data separation.

How do I handle loading and error states in Flutter Bloc or Cubit?

Handle loading and error states in Flutter Bloc or Cubit by defining immutable state classes that explicitly represent loading, error, and data conditions. This separates screen-level state from widgets and ensures consistent error handling across the application.

Does this approach support dependency injection and routing for Flutter state management?

Yes, this Flutter state management approach supports dependency injection and routing integration. It configures DI and routes according to the existing repository architecture while applying Bloc, Cubit, or Riverpod to manage feature-specific states.