riverpod-consumers

Read and watch Riverpod providers in Flutter widgets using WidgetRef.

8|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/serverpod/skills-registry --skill riverpod-consumers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: riverpod-consumers
Source: https://github.com/serverpod/skills-registry/tree/main/skills/riverpod/riverpod-consumers
Command: npx skills add https://github.com/serverpod/skills-registry --skill riverpod-consumers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables Flutter widgets to access and react to changes in Riverpod providers, which is essential for managing application state effectively.

Core Features & Use Cases

  • Provider Access: Read and watch Riverpod providers within your widget tree.
  • Widget Integration: Seamlessly integrate provider data into your UI using Consumer, ConsumerWidget, or ConsumerStatefulWidget.
  • Use Case: When building a Flutter app with Riverpod, you need to display data from a user profile provider in a Text widget. This Skill shows you how to use ConsumerWidget to achieve this.

Quick Start

Use the riverpod-consumers skill to convert the attached StatelessWidget to a ConsumerWidget.

Frequently Asked Questions about riverpod-consumers

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

FAQPage Schema
How do I access Riverpod providers inside a Flutter widget?

You can access Riverpod providers inside a Flutter widget by converting your StatelessWidget to a ConsumerWidget or ConsumerStatefulWidget, then using WidgetRef to read or watch the desired providers for reactive UI updates.

What is the difference between ConsumerWidget and Consumer in Riverpod?

ConsumerWidget replaces StatelessWidget to expose a WidgetRef for provider access, while Consumer wraps an existing widget subtree to grant provider access without changing the parent widget type.

How do I display Riverpod provider data in a Text widget?

To display Riverpod provider data in a Text widget, use a ConsumerWidget and call ref.watch inside the build method to pass the provider state directly to the Text widget for reactive updates.

When should I use ref.read instead of ref.watch with WidgetRef?

Use ref.watch inside a build method to subscribe to provider changes and rebuild the UI, and use ref.read inside event handlers or callbacks to access provider values without triggering UI rebuilds.

Can I use Riverpod providers with a StatefulWidget in Flutter?

Yes, you can use Riverpod providers with a StatefulWidget by converting it to a ConsumerStatefulWidget, which exposes a WidgetRef through the ConsumerState for reading and watching providers.

Do I need to manually manage provider subscriptions in ConsumerWidget?

No, you do not need to manually manage provider subscriptions in ConsumerWidget. Using ref.watch inside the build method automatically handles subscription lifecycle and reactive UI updates.