riverpod-family
Use Riverpod family providers to pass parameters and cache per parameter; FutureProvider.family, NotifierProvider.family, autoDispose with family, overriding…
Skill by serverpod
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/serverpod-riverpod-family
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/riverpod-family
What's inside
- Skill name
riverpod-family- Description
- Use Riverpod family providers to pass parameters and cache per parameter; FutureProvider.family, NotifierProvider.family, autoDispose with family, overriding in tests. Use when fetching data by ID, pagination, or any provider that depends on a parameter. Use this skill when the user asks about family, provider parameters, or caching by ID.
- License
- BSD-3-Clause
- Instructions
- 63 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Riverpod — Family
## Instructions
**Family** lets a single provider have multiple independent states, one per parameter combination (like a Map from parameter to state). Use it for API calls that depend on an ID, query, or page number.
### Creating a family (functional)
Add `.family` and an extra type parameter for the argument. The provider function receives `(ref, param)`:
```dart
final userProvider = FutureProvider.autoDispose.family<User, String>((ref, id) async {
final dio = Dio();
final response = await dio.get('https://api.example.com/users/$id');
return User.fromJson(response.data);
});
```
With code generation, add parameters to the function; the generated provider accepts arguments: `userProvider(id)`.
### Creating a family (Notifier)
Use `NotifierProvider.family` / `AsyncNotifierProvider.family` (and `.autoDispose.family`). The Notifier must have a constructor that stores the parameter:
```dart
final userProvider = AsyncNotifierProvider.autoDispose.family<UserNotifier, User, String>(
UserNotifier.new,
);
class UserNotifier extends AsyncNotifier<User> {
UserNotifier(this.id);
final String id;
@override
Future<User> build() async {
final dio = Dio();
final response = await dio.get('https://api.example.com/users/$id');
return User.fromJson(response.data);
}
}
```
### Using a family
Pass the parameter when watching or reading:
```dart
final user = ref.watch(userProvider('123'));
final other = ref.watch(userProvider('456')); // independent state
```
Parameters must have consistent **==** and **hashCode**. Do not use mutable or list/map literals as parameters (e.g. `ref.watch(myProvider([1,2,3]))` is wrong because `[1,2,3] != [1,2,3]`). Prefer primitives or custom classes with ==/hashCode. Enable riverpod_lint provider_parameters rule to catch mistakes.
### Auto-dispose with family
Enable auto-dispose when using family so that when the parameter goes out of use (e.g. user navigates away), that parameter's state can be disposed and you avoid unbounded cache growth.
### Overriding in tests
- Override a single parameter: pass the same parameter to the override.
- Override all parameters: override with a provider that ignores the parameter or returns a fixed value. See riverpod-overrides and the docs for exact syntax.From serverpod/skills-registry, BSD-3-Clause.
More from serverpod/skills-registry
- 0.475score
riverpod-faq-and-practices
serverpod
Answers Riverpod FAQ (ref.refresh vs invalidate, ConsumerWidget vs StatelessWidget, Ref vs WidgetRef, reset all providers, ref after unmount) and do/don't…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-getting-started
serverpod
Install Riverpod (flutter_riverpod or riverpod), wrap the app in ProviderScope, run a hello-world provider, and optionally enable riverpod_lint and code…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-containers
serverpod
Use ProviderScope in Flutter and ProviderContainer in Dart for Riverpod; where provider state is stored, overrides, observers, testing with…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-eager-initialization
serverpod
Eagerly initialize Riverpod providers at app startup by watching them in a root Consumer; handle loading/error in the initializer, AsyncValue.requireValue.
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-consumers
serverpod
Use Riverpod Consumer, ConsumerWidget, and ConsumerStatefulWidget to read and watch providers in widgets; WidgetRef, builder ref parameter.
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-from-provider
serverpod
Migrate from package:provider to Riverpod; ChangeNotifierProvider, ProxyProvider to ref.watch, context.watch to ref.watch, ConsumerWidget, incremental…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-testing
serverpod
Test Riverpod providers and widgets; ProviderContainer.test, unit tests, widget tests with ProviderScope, tester.container(), mocking with overrides…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-3-0-migration
serverpod
Migrate Riverpod from 2.0 to 3.0; automatic retry, paused listeners, legacy providers import, Ref simplification, FamilyNotifier removal, ProviderException…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-auto-dispose
serverpod
Enable automatic disposal of Riverpod providers when they have no listeners; keepAlive, onDispose, invalidate, ref.keepAlive.
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-cancel
serverpod
Cancel or debounce Riverpod async requests with ref.onDispose; cancel when user leaves the page, debounce rapid refreshes.
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-codegen-and-hooks
serverpod
Use Riverpod code generation (@riverpod, riverpod_generator) and hooks (hooks_riverpod, HookConsumerWidget, flutter_hooks with Riverpod).
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-migration
serverpod
Migrate Riverpod from StateNotifier to Notifier/AsyncNotifier, from ChangeNotifier to AsyncNotifier, or upgrade from 0.13/0.14/1.0; ref.onDispose, family…
SkillDFreshness: D★ 10Claude Code +9
Signals
- Stars
- 10
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 7, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- BSD-3-Clause
- Repository
- github.com/serverpod/skills-registry
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from serverpod
- 0.475score
riverpod-auto-dispose
serverpod
Enable automatic disposal of Riverpod providers when they have no listeners; keepAlive, onDispose, invalidate, ref.keepAlive.
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-codegen-and-hooks
serverpod
Use Riverpod code generation (@riverpod, riverpod_generator) and hooks (hooks_riverpod, HookConsumerWidget, flutter_hooks with Riverpod).
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-testing
serverpod
Test Riverpod providers and widgets; ProviderContainer.test, unit tests, widget tests with ProviderScope, tester.container(), mocking with overrides…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-3-0-migration
serverpod
Migrate Riverpod from 2.0 to 3.0; automatic retry, paused listeners, legacy providers import, Ref simplification, FamilyNotifier removal, ProviderException…
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-cancel
serverpod
Cancel or debounce Riverpod async requests with ref.onDispose; cancel when user leaves the page, debounce rapid refreshes.
SkillDFreshness: D★ 10Claude Code +9 - 0.475score
riverpod-consumers
serverpod
Use Riverpod Consumer, ConsumerWidget, and ConsumerStatefulWidget to read and watch providers in widgets; WidgetRef, builder ref parameter.
SkillDFreshness: D★ 10Claude Code +9
Cite this page
riverpod-family skill. Agent Mart. https://agentmart.dev/skills/serverpod-riverpod-family (last updated 2026-10-24)