provider

Implement the Provider package for Flutter state management with MultiProvider.

611|60|Updated Apr 22, 2025
One-click install
npx skills add https://github.com/evanca/flutter-ai-rules --skill provider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: provider
Source: https://github.com/evanca/flutter-ai-rules/tree/main/skills/provider
Command: npx skills add https://github.com/evanca/flutter-ai-rules --skill provider

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flutter apps often struggle with cleanly sharing and updating app state across widgets; Provider offers a lightweight, scalable pattern for DI and state management that keeps concerns separated and widgets reactive.

Core Features & Use Cases

  • Provider types: Provider, ChangeNotifierProvider, FutureProvider, StreamProvider, ProxyProvider for exposing immutable values, mutable state, asynchronous data, and inter-dependencies.
  • Setup and consumption: Use MultiProvider to group providers and context.watch/read/select for optimized rebuilds.
  • Migration and debugging: Guidance for migrating from deprecated patterns and debugging with DevTools.

Quick Start

Add the provider package to your Flutter project and wrap your app with MultiProvider to expose and consume your state.

Frequently Asked Questions about provider

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

FAQPage Schema
How do I manage Flutter state with Provider and MultiProvider?

To manage Flutter state with Provider, wrap your app with MultiProvider to group providers and expose state. You can then consume state reactively across widgets using context.watch, read, or select for optimized rebuilds.

What Flutter Provider types should I use for async data and mutable state?

For Flutter state management, use ChangeNotifierProvider for mutable state, FutureProvider and StreamProvider for asynchronous data, and ProxyProvider to expose inter-dependencies between separate providers.

How do I optimize widget rebuilds when consuming Provider state in Flutter?

Optimize Provider rebuilds in Flutter by using context.select to listen only to specific slices of state, or context.read to retrieve state without triggering widget rebuilds on subsequent updates.

How do I migrate deprecated Provider APIs in my Flutter app?

Migrate deprecated Provider APIs in your Flutter app by following structured guidelines for updating setup patterns and consumption methods, ensuring your state management aligns with current production-quality best practices.

When do I need ProxyProvider for dependency injection in Flutter?

You need ProxyProvider in Flutter when managing dependency injection for inter-dependent values, allowing a provider to depend on other providers and recalculate its exposed state automatically when dependencies change.

What is the best way to debug Provider state management issues in Flutter?

The best way to debug Provider state issues in Flutter is using DevTools to inspect widget rebuilds and state changes, helping identify performance considerations and unnecessary widget tree updates.