Skip to content
pubscout

provider

6.1.5+1, released a year ago by dash-overflow.net

A lightweight wrapper around InheritedWidget for state management

Flutter FavoriteWASM-ready
$ flutter pub add provider
Source repository

What it does

Provider exposes values via InheritedWidgets, simplifying resource allocation, lazy loading, and rebuilds. It offers convenient context extensions like watch, read, and select for consuming state.

AI-written summary of version 6.1.5+1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Simple state management with ChangeNotifier or ValueNotifier
  • Small to medium apps needing dependency injection
  • When you want devtools visibility of provider state

Skip it when

  • Large, complex state that benefits from advanced patterns like Riverpod or Bloc
  • When you need code generation for models or forms

Strengths

  • Simple API, minimal boilerplate
  • Built‑in devtools integration
  • Lazy loading and efficient rebuilds

Weaknesses

  • No built‑in code generation
  • Limited to InheritedWidget under the hood, may feel less modern than Riverpod
  • Can become verbose for many providers

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
Provider(
  create: (_) => MyModel(),
  child: MyApp(),
);

Alternatives

Packages that do the same job and could replace provider.

  • riverpod

    Provides a more modern, testable, and feature‑rich approach to state management and dependency injection, with null safety and code generation support.

Works with

Packages commonly used together with provider: ones it builds on, ones built on it, and its own family.