riverpod-select

Watch subsets of Riverpod provider state to minimize widget rebuilds.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses unnecessary widget rebuilds in Riverpod by allowing you to watch only specific parts of a provider's state, improving application performance.

Core Features & Use Cases

  • Selective State Watching: Use ref.watch(provider.select(...)) to subscribe to only a subset of a provider's state.
  • Performance Optimization: Reduces rebuilds when only a small portion of a larger state object changes.
  • Use Case: When a widget displays a user's name from a large User object, and the user's address (another field in the User object) changes frequently, select prevents the widget from rebuilding unnecessarily.

Quick Start

Use the riverpod-select skill to watch only the 'firstName' property of the 'userProvider'.

Frequently Asked Questions about riverpod-select

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

FAQPage Schema
How do I prevent unnecessary widget rebuilds in Flutter when using Riverpod?

You can prevent unnecessary Flutter widget rebuilds by using Riverpod's `select` filter to watch only specific subsets of a provider's state. This ensures widgets only rebuild when the exact fields they consume actually change.

What is the best way to watch a single property of a large state object in Riverpod?

The best way to watch a single property of a large state object in Riverpod is using `ref.watch(provider.select(...))`. This selectively subscribes your widget to a specific subset of the provider state, minimizing rebuilds when other fields update.

When should I use select for Riverpod state management?

You should use select for Riverpod state management in performance-critical applications with complex state objects. It is specifically needed when a widget consumes only a small portion of a larger state object and you want to avoid rebuilding when unrelated fields change.

Does Riverpod select require immutable state objects to trigger rebuilds correctly?

Yes, Riverpod select requires adherence to immutability principles for selected values. Maintaining immutable state objects ensures that changes to the watched subsets are correctly detected, which is necessary to trigger accurate widget rebuilds.

Why does my Flutter widget still rebuild when I use Riverpod select?

Your Flutter widget may still rebuild if immutability principles are not followed for the selected values. If the watched subset of the provider state is not properly immutable, Riverpod cannot detect that the specific field remained unchanged, triggering unnecessary rebuilds.