riverpod-refs

Explain reading, watching, listening, invalidating, and refreshing Riverpod providers in Dart.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/chetan2921/flo --skill riverpod-refs-chetan2921
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: riverpod-refs
Source: https://github.com/chetan2921/flo/tree/main/.github/skills/riverpod-refs
Command: npx skills add https://github.com/chetan2921/flo --skill riverpod-refs-chetan2921

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies understanding how to interact with Riverpod providers by explaining key methods and lifecycle callbacks used for state management.

Core Features & Use Cases

  • Provider Interaction: Guides on how to read, watch, listen, invalidate, and refresh Riverpod providers within Flutter widgets or providers.
  • Lifecycle Management: Explains how to use onDispose, onCancel, and onResume callbacks to manage provider cleanup and lifecycle events.
  • Use Case: A developer wants to implement a provider that updates UI on data changes and cleans up resources properly when no longer needed.

Quick Start

Use this Skill to understand how to optimally read and listen to provider states in a Flutter app using Riverpod.

Frequently Asked Questions about riverpod-refs

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

FAQPage Schema
How do I read and watch Riverpod provider states in Flutter?

To read and watch Riverpod provider states in Flutter, you use ref methods to interact with providers, allowing widgets to access state and rebuild automatically when observed data updates.

What is the best way to manage Riverpod provider lifecycle and resource cleanup?

Managing Riverpod provider lifecycle involves using callbacks like onDispose and onCancel to trigger proper resource cleanup, ensuring that controllers and streams are safely discarded when they are no longer needed.

How do I listen to and invalidate Riverpod providers?

You can listen to and invalidate Riverpod providers by utilizing ref methods to subscribe to state alterations and manually force provider re-evaluation or refresh stale data streams within your application.

Does Riverpod ref support refreshing provider states dynamically?

Yes, Riverpod ref supports refreshing provider states dynamically by invoking ref.refresh, which forces the provider to recreate its current state and fetch new data while properly handling previous resource disposal.

When should I use ref.listen versus ref.watch for Flutter state management?

Use ref.watch in Flutter state management to rebuild widgets on provider changes, whereas ref.listen should be used to trigger side effects like navigation or showing modals without rebuilding the widget tree.