riverpod-providers

Declare and consume Riverpod providers for memoized state across Dart and Flutter widgets.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/masssi164/weave --skill riverpod-providers-masssi164
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: riverpod-providers
Source: https://github.com/masssi164/weave/tree/main/.agent/skills/riverpod-providers
Command: npx skills add https://github.com/masssi164/weave --skill riverpod-providers-masssi164

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Riverpod providers solve the challenge of sharing state and logic across Dart/Flutter widgets by providing memoized, testable, and easily composed providers.

Core Features & Use Cases

  • Provider variants: Provider (sync), FutureProvider, StreamProvider, NotifierProvider, AsyncNotifierProvider, StreamNotifierProvider.
  • Modularity and scope: top-level final providers, Ref for reading/watching; autoDispose and family modifiers.
  • Usage patterns: Use with ProviderScope in Flutter, or a ProviderContainer in Dart-only environments; interact via ref.read / ref.watch or notifier methods.
  • Use case example: Share user session data across screens with a Notifier; fetch async data with FutureProvider; stream live updates with StreamProvider.

Quick Start

Define a top-level provider and access it via a ProviderScope in your app.

Frequently Asked Questions about riverpod-providers

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

FAQPage Schema
How do I declare and consume Riverpod providers in Flutter?

To declare Riverpod providers, define top-level final variables using Provider or NotifierProvider variants, then consume them in Flutter widgets via ProviderScope using ref.watch or ref.read to access memoized state.

What is the difference between FutureProvider and StreamProvider in Dart?

FutureProvider fetches and caches asynchronous data returning a single result, while StreamProvider listens to streaming data emitting multiple values over time. Both expose memoized state and handle loading and error states automatically.

Can I use Riverpod state management in a Dart-only environment without Flutter?

Yes, Riverpod works in Dart-only environments by using a ProviderContainer instead of a ProviderScope. You can declare top-level providers and interact with their state via ref.read and ref.watch to share logic outside of Flutter widgets.

When should I use autoDispose and family modifiers with NotifierProvider?

Use the autoDispose modifier when state should be destroyed when no longer listened to, preventing memory leaks. Use the family modifier to create parameterized providers that generate state dynamically based on input arguments.

How does AsyncNotifierProvider handle complex state flows in Flutter?

AsyncNotifierProvider manages complex asynchronous state flows by encapsulating mutable state and async logic within a Notifier class. It exposes methods to update state and integrates with ref to read and watch other providers seamlessly.

Why use NotifierProvider instead of a basic Provider for Flutter state management?

NotifierProvider enables mutable state management by exposing notifier methods to update state directly, whereas a basic Provider only exposes read-only computed values. This makes NotifierProvider suitable for interactive state flows.