Flutter riverpod state management

From HoangNguyen0403/agent-skills-standard · View interactive version

Flutter riverpod state management is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Implement reactive state management using Riverpod 3.x with code generation in Flutter. Use when defining providers, building AsyncNotifiers, or overriding providers in tests.

How to use this skill

Skill file

Riverpod State Management

**Priority: P0 (CRITICAL)**

Targets Riverpod 3.x. Notifier/AsyncNotifier codegen surface is unchanged from 2.x; Riverpod 3 adds automatic retry with backoff and pause/resume for offline — do not hand-roll retry logic that the framework already provides.

Structure

lib/
├── providers/ # Global providers and services
└── features/user/
    ├── providers/ # Feature-specific providers
    └── models/    # @freezed domain models

Provider Definition (Generator-First)

Use @riverpod annotations for all provider definitions. See implementation examples for full provider and consumer patterns.

Consuming Providers

Use ConsumerWidget with ref.watch() and AsyncValue.when() for reactive UI. See implementation examples.

Implementation Guidelines

Anti-Patterns

Related Topics

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.