provider

Implements state management in Flutter apps using the Provider package.

1|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/sohampawar1866/zeromile-go --skill provider-sohampawar1866
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: provider
Source: https://github.com/sohampawar1866/zeromile-go/tree/main/.agents/skills/provider
Command: npx skills add https://github.com/sohampawar1866/zeromile-go --skill provider-sohampawar1866

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Flutter developers often struggle with choosing the right provider type, wiring up dependency injection, avoiding unnecessary widget rebuilds, and migrating away from deprecated APIs. This Skill provides authoritative guidance for using the Provider package correctly. ## Core Features & Use Cases - Provider Selection: Maps use cases to the correct provider type (Provider, ChangeNotifierProvider, FutureProvider, StreamProvider, ProxyProvider). - Rebuild Optimization: Shows how to use context.select, Consumer, and Selector to limit widget rebuilds to only the state that changed. - Migration Guidance: Explains how to replace the deprecated ValueListenableProvider with Provider combined with ValueListenableBuilder. - Use Case: When building a Flutter app where an API client depends on an auth token, use ChangeNotifierProxyProvider so the API object automatically updates whenever the auth state changes. ## Quick Start Ask the AI to set up a MultiProvider with a ChangeNotifierProvider for your model and show how to consume it with context.watch and context.select in a Flutter widget.

Frequently Asked Questions about provider

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

FAQPage Schema
How do I use Provider for state management in Flutter?

Wrap your app in MultiProvider with providers like ChangeNotifierProvider, then consume state with context.watch<MyModel>() inside build for rebuilds or context.read<MyModel>() in callbacks. Always specify the generic type for type safety.

What is the difference between context.watch, context.read, and context.select?

context.watch listens and rebuilds the widget on change and is only valid inside build. context.read accesses the object without listening, suited for callbacks. context.select listens to only part of the state, limiting rebuilds to that value.

When should I use ProxyProvider in Flutter?

Use ProxyProvider or ChangeNotifierProxyProvider when an object depends on another provider or on values that change over time. Never build a provider's object from changing variables directly, since it will not update when those variables change.

Why is ValueListenableProvider deprecated and what replaces it?

ValueListenableProvider is deprecated in the Provider package. Replace it with a ValueListenableBuilder that wraps its child in Provider.value, passing the current listenable value down the tree.

Why does my Flutter app throw StackOverflowError with many providers?

Mounting 150 or more providers at once can cause a StackOverflowError. Mount providers incrementally over time, for example during a splash screen, instead of registering all of them in a single MultiProvider.