AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified BSD-3-Clause Self-run

Riverpod Family

skill-serverpod-skills-registry-riverpod-family · by serverpod

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.

No reviews yet
0 installs
16 views
0.0% view→install

Install

$ agentstack add skill-serverpod-skills-registry-riverpod-family

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-serverpod-skills-registry-riverpod-family)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Riverpod Family? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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):

final userProvider = FutureProvider.autoDispose.family((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:

final userProvider = AsyncNotifierProvider.autoDispose.family(
  UserNotifier.new,
);

class UserNotifier extends AsyncNotifier {
  UserNotifier(this.id);
  final String id;

  @override
  Future 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:

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 riverpodlint providerparameters 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.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.