Agent skill

riverpod

Use when setting up providers, combining requests, managing state disposal, passing arguments, performing side effects, or testing providers (Riverpod).

evancagithub.com/evancaGitHub ↗
claude-codecodexcursorwindsurfMIT
Install
npx skills add evanca/flutter-ai-rules --skill riverpod --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 7 KB
Bundled scripts: none
Path: skills/riverpod/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 604
Language: Shell

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Riverpod Skill This skill defines how to correctly use Riverpod for state management in Flutter and Dart applications. --- ## 1. Setup ```dart void main() { runApp(const ProviderScope(child: MyApp())); } ``` - Wrap your app with `ProviderScope` directly in `runApp` — never inside `MyApp`. - Install and use `riverpod_lint` to enable IDE refactoring and enforce best practices. --- ## 2. Defining Providers ```dart // Functional provider (codegen) @riverpod int example(Ref ref) => 0; // FutureProvider (codegen) @riverpod Future<List<Todo>> todos(Ref ref) async { return ref.watch(repositoryProvider).fetchTodos(); } // Notifier (codegen) @riverpod class TodosNotifier extends _$TodosNotifier { @override Future<List<Todo>> build() async { return ref.watch(repositoryProvider).fetchTodos(); } Future<void> addTodo(Todo todo) async { ... } } ``` - Define all providers as **`final` top-level variables**. - Use `Provider`, `FutureProvider`, or `StreamProvider` based on the return type. - Use `ConsumerWidget` or `ConsumerStatefulWidget` instead of `StatelessWidget`/`StatefulWidget` when accessing providers. --- ## 3. Using Ref | Method | Use for | |---|---| | `ref.watch` | Reactively listen — r

What's inside
Steps it walks through
  1. 1. Setup
  2. 2. Defining Providers
  3. 3. Using Ref
  4. 4. Combining Providers
  5. 5. Passing Arguments (Families)
  6. 6. Auto Dispose & State Lifecycle
  7. 7. Eager Initialization
  8. 8. Performing Side Effects
  9. 9. Provider Observers
  10. 10. Testing
  11. References
More from flutter-ai-rules
All skills →
About this skill
What does the riverpod skill do?

Use when setting up providers, combining requests, managing state disposal, passing arguments, performing side effects, or testing providers (Riverpod).

How do I install it?

Run `npx skills add evanca/flutter-ai-rules --skill riverpod --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From evanca/flutter-ai-rules, a repository with 604 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going