riverpod-containers

Manage Riverpod state storage and access across Flutter and Dart tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Providers themselves hold no state. State is stored in a ProviderContainer. In Flutter you use the ProviderScope widget, which creates and exposes a container to the widget tree.

Core Features & Use Cases

  • Scope-based state management: Understand how ProviderScope exposes a ProviderContainer to the widget tree in Flutter apps.
  • Container-based testing: Use ProviderContainer (and ProviderContainer.test()) in Dart tests to create isolated, disposable state containers.
  • Overrides and observers: Configure container overrides and observers to customize provider behavior during tests and in non-UI contexts.

Quick Start

Wrap your app at the root with ProviderScope to expose a container and start reading providers.

Frequently Asked Questions about riverpod-containers

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

FAQPage Schema
How do I manage Riverpod state in Flutter tests without a widget tree?

Manage Riverpod state in isolated tests by creating a disposable ProviderContainer.test() instance in pure Dart, allowing you to read providers and override state without needing a Flutter widget tree.

How does ProviderScope expose Riverpod state to a Flutter app?

ProviderScope is a widget that wraps your app at the root to create and expose a ProviderContainer, providing the underlying state storage that holds and distributes Riverpod provider state to the widget tree.

Can I override provider behavior during Dart testing?

Yes, you can configure container overrides and observers when setting up your ProviderContainer, allowing you to customize and monitor provider behavior during testing in non-UI contexts.

What is the difference between ProviderScope and ProviderContainer in Riverpod?

ProviderScope is the Flutter widget that exposes a ProviderContainer to the widget tree, while ProviderContainer is the actual object that stores provider state, which can also be used independently in pure Dart tests.

Do I need ProviderScope to use ref.watch and ref.read in Flutter?

Yes, you must wrap your app with ProviderScope to expose a ProviderContainer, enabling the use of ref.watch and ref.read to access and manage Riverpod state throughout the widget tree.

How do I isolate state across multiple Riverpod tests?

Isolate state across tests by creating separate, disposable ProviderContainer.test() instances for each test, ensuring that state storage and overrides do not leak between test cases.