Skip to content
Development
Skill

/flutter-riverpod-state-management

Implement reactive state management using Riverpod 3.x with code generation in Flutter. Use when defining providers, building AsyncNotifiers, or overriding providers in tests.

From plugin
agent-skills-standard
583200 skills21 agents33 commands1 MCP

Claude Code

$ npx -y skills add hoangnguyen0403/agent-skills-standard --skill flutter-riverpod-state-management --agent claude-code

SKILL.md

flutter-riverpod-state-management.SKILL.md
name: flutter-riverpod-state-management
description: Implement reactive state management using Riverpod 3.x with code generation in Flutter. Use when defining providers, building AsyncNotifiers, or overriding providers in tests.
metadata:
  triggers:
    files:
    - '**_provider.dart'
    - '**_notifier.dart'
    keywords:
    - riverpod
    - ProviderScope
    - ConsumerWidget
    - Notifier
    - AsyncValue
    - ref.watch
    - "@riverpod"

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](references/implementation.md) for full provider and consumer patterns.

Consuming Providers

Use `ConsumerWidget` with `ref.watch()` and `AsyncValue.when()` for reactive UI. See [implementation examples](references/implementation.md).

Implementation Guidelines

  • **Generator First**: Use `@riverpod` annotations. Avoid manual `Provider` definitions.
  • **Immutability**: Use `Freezed` for all state models.
  • **ref.watch()**: Inside `build()` to rebuild on changes.
  • **ref.listen()**: Inside `build()` for side-effects (navigation, dialogs). Never in provider init.
  • **ref.read()**: ONLY in callbacks (`onPressed`).
  • **Testing**: Override providers with `ProviderScope(overrides: [provider.overrideWithValue(Mock())])`.
  • **Linting**: Enable `riverpod_lint` and `custom_lint` for cycle detection.

Anti-Patterns

  • **No side-effects in provider init**: Use `ref.listen()` in widgets instead.
  • **No BuildContext in Notifiers**: Never pass `BuildContext` into Notifier/Provider.
  • **No local provider instantiation**: Keep providers global; avoid dynamic creation.

Related Topics

  • [flutter-layer-based-clean-architecture](../flutter-layer-based-clean-architecture/SKILL.md)
  • [flutter-dependency-injection](../flutter-dependency-injection/SKILL.md)
  • [flutter-testing](../flutter-testing/SKILL.md)
Read more
@hoangnguyen0403
Ships withagent-skills-standard

The portable standards layer for AI coding agents. Sync once, then work in your own runtime.

583200 skills21 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
583
Star history of hoangnguyen0403/agent-skills-standard on GitHub, a chart by star-history.com

Other skills on agent-skills-standard.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about flutter-riverpod-state-management.

Which coding agents can use flutter-riverpod-state-management?
flutter-riverpod-state-management installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.