riverpod-consumers

Convert Flutter widgets to ConsumerWidget for reading Riverpod providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the need for widgets in Flutter applications to efficiently access and react to state managed by Riverpod providers, enabling dynamic and responsive user interfaces.

Core Features & Use Cases

  • Provider Access: Read and watch Riverpod providers directly within widget build methods.
  • Widget Integration: Provides Consumer, ConsumerWidget, and ConsumerStatefulWidget for seamless integration with the Riverpod ecosystem.
  • Use Case: When building a Flutter app with Riverpod, you need to display data from a userProvider in a Text widget. This Skill shows you how to use ConsumerWidget to watch userProvider and update the Text widget whenever the user data changes.

Quick Start

Use the riverpod-consumers skill to convert your existing StatelessWidget into 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 consume Riverpod providers in Flutter widgets?

You can access Riverpod providers using `WidgetRef` inside your build methods to read and watch state, which triggers reactive UI updates whenever the underlying provider data changes.

What is the difference between ConsumerWidget and ConsumerStatefulWidget in Flutter?

`ConsumerWidget` replaces `StatelessWidget` for reading provider state, while `ConsumerStatefulWidget` pairs with `ConsumerState` to manage local widget state alongside Riverpod providers.

How do I convert a StatelessWidget to a ConsumerWidget for Riverpod state management?

To convert a `StatelessWidget` to a `ConsumerWidget` for Riverpod state management, extend `ConsumerWidget` and use the provided `WidgetRef` to watch providers directly inside the build method.

When should I use the Consumer widget instead of ConsumerWidget in Flutter?

Use the `Consumer` widget when you want to limit widget rebuilds to a specific subtree, whereas `ConsumerWidget` rebuilds the entire widget when the watched Riverpod provider state changes.

Can I watch a Riverpod userProvider to update a Text widget in Flutter?

Yes, you can watch a `userProvider` to update a `Text` widget by using a `ConsumerWidget` and calling `ref.watch(userProvider)` inside the build method to display dynamic user data.

Do I need to manually trigger UI updates when reading Riverpod state in Flutter?

No, you do not need to manually trigger UI updates when reading Riverpod state; using `WidgetRef` to watch providers ensures the Flutter UI automatically reacts and rebuilds upon state changes.