riverpod

Manage Flutter state with Riverpod providers, notifiers, and ref APIs.

611|60|Updated Apr 22, 2025
One-click install
npx skills add https://github.com/evanca/flutter-ai-rules --skill riverpod
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: riverpod
Source: https://github.com/evanca/flutter-ai-rules/tree/main/skills/riverpod
Command: npx skills add https://github.com/evanca/flutter-ai-rules --skill riverpod

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Riverpod provides a structured, scalable approach to state management in Flutter/Dart, reducing boilerplate and improving testability and performance.

Core Features & Use Cases

  • Setup and usage of Riverpod codegen patterns for providers, notifiers, and state management.
  • Guidelines for using ref.watch, ref.read, and ref.listen; best practices for autoDispose and state lifecycles.
  • Real-world scenario: building a Todo app with repositories and providers to manage state.

Quick Start

Add ProviderScope around your app and implement a simple provider to demonstrate Riverpod usage.

Frequently Asked Questions about riverpod

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

FAQPage Schema
How do I manage Flutter state consistently using Riverpod providers?

Manage Flutter state consistently by mastering Riverpod providers, notifiers, and state lifecycles. This approach reduces boilerplate and improves testability and performance when building robust UI with provider patterns.

What is the best way to use ref.watch, ref.read, and ref.listen in Flutter?

The best way to use ref APIs in Flutter is following specific guidelines for ref.watch, ref.read, and ref.listen. These APIs handle side effects and ensure proper state management and disposal within ConsumerWidget implementations.

How do I set up Riverpod codegen for providers and notifiers in Dart?

Set up Riverpod codegen in Dart by applying codegen patterns for providers and notifiers. This structured approach generates necessary boilerplate, allowing you to build robust UI with provider patterns efficiently in Flutter projects.

When do I need autoDispose for Flutter state lifecycles?

You need autoDispose for Flutter state lifecycles to ensure proper disposal of providers when they are no longer listened to. Following autoDispose best practices prevents memory leaks and optimizes app performance.

Does Riverpod work with testing providers in Flutter?

Riverpod works with testing providers in Flutter by providing a structured, scalable approach to state management that improves testability. You can test providers handling side effects and state lifecycles effectively.

How do I build a Todo app with repositories and providers in Flutter?

Build a Todo app in Flutter by implementing repositories and providers to manage state. This real-world scenario demonstrates combining providers, passing arguments, and handling side effects using Riverpod.