provider
A wrapper around InheritedWidget to make them easier to use and more reusable.
6.1.5
1.1M downloads/mo
#336 most downloaded on pub.dev
rrousselGit/provider
What this package is like to depend on
Last release 1 years ago
19 Aug 2025
Release timing varies
gaps range from 5 weeks to 13 months
Most releases are documented
notes for 47 of 53 stable releases
1 version withdrawn
withdrawn after publishing
8 years old
70 releases · first in 2018
0 releases in the last 12 months
see the full history below
Release timeline
70 releases · Oct 2018 to Aug 2025Releases
latest 60 of 70-
6.1.529 Apr 2025Release notes
Open source →Fix a bug where a bug reading another provider may obtain the wrong value.
-
6.1.5+119 Aug 2025 -
6.1.426 Mar 2025 -
6.1.326 Mar 2025 withdrawnRelease notes
Open source →- Significantly increase the number of providers that MultiProvider can create at once without causing a
StackOverflow.
- Significantly increase the number of providers that MultiProvider can create at once without causing a
-
6.1.228 Feb 2024Release notes
Open source →- Fixed an issue with
Selectornot rebuilding when thebuilderlistens to InheritedWidgets (thanks to @spkersten)
- Fixed an issue with
-
6.1.110 Nov 2023 -
6.1.008 Nov 2023 -
6.1.0-dev.124 Sep 2023 pre-release -
6.1.0-dev.024 Sep 2023 pre-releaseRelease notes
Open source →- Moved the implementation of the devtool extension in the source of Provider (thanks to @kenzieschmoll)
-
6.0.514 Dec 2022 -
6.0.411 Oct 2022 -
6.0.322 May 2022Release notes
Open source →- fix late initialization error when using
debugPrintRebuildDirtyWidgets - slightly reduced the binary size of release mode applications using provider
- Fix typos in the error message of ProviderNotFoundException
- improve performances for reading providers (thanks to @jiahaog)
- fix late initialization error when using
-
6.0.229 Dec 2021Release notes
Open source →Added error details for provider that threw during the creation (thanks to @jmewes)
-
6.0.124 Sep 2021Release notes
Open source →Removed the assert that prevented from using
ChangeNotifierProviderwith notifiers that already had listeners. -
6.0.019 Aug 2021Release notes
Open source →-
Breaking: It is no longer possible to define providers where their only difference is the nullability of the exposed value:
MultiProvider( providers: [ Provider<Model>(...), Provider<Model?>(...) ] )Before, when defining those providers, doing
context.watch<Model>vscontext.watch<Model?>would point to a different provider. Now, both will always point to the deepest provider (in this exampleProvider<Model?>).That fixes issues where a common developer mistake is to define a provider as
Model?but try to read it asModel. Previously, that would give aProviderNotFoundException. Now, this will correctly resolve the value.That also helps large codebase migrate to null-safety progressively, as they would temporarily contain both null-safe and unsound code. Previously, unsound code would be unable to read a provider defined as
Provider<Model?>, asModel?is not a valid syntax. With this change, this is now feasible. -
It is now possible to read a provider without throwing a
ProviderNotFoundExceptionif the provider is optional.To do so, when calling
context.watch/context.read, make the generic type nullable. Such that instead of:context.watch<Model>()which will throw a
ProviderNotFoundExceptionif no matching providers are found, do:context.watch<Model?>()which will try to obtain a matching provider. But if none are found,
nullwill be returned instead of throwing.
-
-
6.0.0-dev12 Jul 2021 pre-releaseRelease notes
Open source →-
Breaking: It is no longer possible to define providers where their only difference is the nullability of the exposed value:
MultiProvider( providers: [ Provider<Model>(...), Provider<Model?>(...) ] )Before, when defining those providers, doing
context.watch<Model>vscontext.watch<Model?>would point to a different provider. Now, both will always point to the deepest provider (in this exampleProvider<Model?>).That fixes issues where a common developer mistake is to define a provider as
Model?but try to read it asModel. Previously, that would give aProviderNotFoundException. Now, this will correctly resolve the value.That also helps large codebase migrate to null-safety progressively, as they would temporarily contain both null-safe and unsound code. Previously, unsound code would be unable to read a provider defined as
Provider<Model?>, asModel?is not a valid syntax. With this change, this is now feasible. -
It is now possible to read a provider without throwing a
ProviderNotFoundExceptionif the provider is optional.To do so, when calling
context.watch/context.read, make the generic type nullable. Such that instead of:context.watch<Model>()which will throw a
ProviderNotFoundExceptionif no matching providers are found, do:context.watch<Model?>()which will try to obtain a matching provider. But if none are found,
nullwill be returned instead of throwing.
-
-
5.0.004 Mar 2021Release notes
Open source →- Stable, null-safe release.
- pre-release of the mechanism for state-inspection using the Flutter devtool
- Updated oudated doc in
StreamProvider
-
5.0.0-nullsafety.520 Feb 2021 pre-releaseRelease notes
Open source →Fixed an issue where providers with an
updateparameter in sound null-safety mode could throw null exceptions. -
5.0.0-nullsafety.417 Feb 2021 pre-release -
5.0.0-nullsafety.318 Jan 2021 pre-releaseRelease notes
Open source →- Improved the error message of
ProviderNotFoundExceptionto mention hot-reload. (#595) - Removed the asserts that prevented
ChangeNotifiers inChangeNotifierProvider()to have listeners (#596) - Removed the opinionated asserts in
context.watch/context.readthat prevented them to be used inside specific conditions (#585)
- Improved the error message of
-
5.0.0-nullsafety.218 Dec 2020 pre-releaseRelease notes
Open source →- Improved the error message when an exception is thrown inside
createof a provider`
- Improved the error message when an exception is thrown inside
-
5.0.0-nullsafety.110 Dec 2020 pre-releaseRelease notes
Open source →- Reintroduced
ValueListenableProvider.value(the default constructor is still removed).
- Reintroduced
-
5.0.0-dev.002 Mar 2021 pre-releaseNothing published for this version
-
4.3.318 Jan 2021Release notes
Open source →- Improved the error message of
ProviderNotFoundExceptionto mention hot-reload. (#595) - Removed the asserts that prevented
ChangeNotifiers inChangeNotifierProvider()to have listeners (#596) - Removed the opinionated asserts in
context.watch/context.readthat prevented them to be used inside specific conditions (#585)
- Improved the error message of
-
4.3.207 Aug 2020 -
4.3.2+120 Aug 2020 -
4.3.2+205 Sep 2020 -
4.3.2+307 Dec 2020 -
4.3.2+414 Jan 2021Release notes
Open source →ValueListenableProvideris no-longer deprecated. Only its default constructor is deprecated (the.valueconstructor is kept) -
4.3.110 Jul 2020Release notes
Open source →- Fixed a bug where hot-reload forced all lazy-loaded providers to be computed.
-
4.3.008 Jul 2020Release notes
Open source →- Added
ReassembleHandlerinterface, for objects to implement so thatproviderlet them handle hot-reload.
- Added
-
4.2.007 Jul 2020Release notes
Open source →-
Added a
builderparameter onMultiProvider(thanks to @joaomarcos96):MultiProvider( providers: [ ChangeNotifierProvider(create: (ct) => Counter()), ], builder: (ctx, child) { final counter = ctx.watch<Counter>(); return Text('${counter.count}'); }, );
-
-
4.1.305 Jun 2020Release notes
Open source →-
Improved the error message of
ProviderNotFoundExceptionwith instructions that better fit what is usually the problem. -
Added documentation on why
context.readshould not be called insidebuild, and what to do instead. -
Improved the performances of
context.select, by not calling the selectors when the provider changes if the widgets listening to the value are already needing build. -
Fixes a bug where
context.watchcouldn't be called insideListView/LayoutBuilder -
Improve the error message when trying to use
context.selectinsideListView.builder -
Improve the error message when calling
context.read/watch/select/Provider.ofwith acontextthat isnull.
-
-
4.1.3+105 Jul 2020 -
4.1.214 May 2020Release notes
Open source →- Loosened the constraint on Flutter's version to be compatible with
betachannel.
- Loosened the constraint on Flutter's version to be compatible with
-
4.1.109 May 2020Release notes
Open source →- Fixes an "aspect" leak with
context.select, leading to memory leaks and unnecessary rebuilds - Fixes the
builderparameter of providers not working (thanks to @passsy)
- Fixes an "aspect" leak with
-
4.1.006 May 2020Release notes
Open source →-
Now requires:
- Flutter >= 1.6.0
- Dart >= 2.7.0
-
Added a
selectextension onBuildContext. It behaves similarly toSelector, but is a lot less verbose to write:With Selector:
Widget build(BuildContext context) { return Selector<Person, String>( selector: (_, p) => p.name, builder: (_, name, __) { return Text(name); }, ), }VS with the new
selectextension:Widget build(BuildContext context) { final name = context.select((Person p) => p.name); return Text(name); } -
Added
builderon the different providers. This parameter simplifies situations where we need a [BuildContext] that can access the new provider.As such, instead of:
Provider( create: (_) => Something(), child: Builder( builder: (context) { final name = context.select((Something s) => s.name); return Text(name); }, ), )we can write:
Provider( create: (_) => Something(), builder: (context, child) { final name = context.select((Something s) => s.name); return Text(name); }, )The behavior is the same. This is only a small syntax sugar.
-
Added a two extensions on [BuildContext], to slightly reduce the boilerplate:
before after Provider.of<T>(context, listen: false)context.read<T>()Provider.of<T>(context)context.watch<T> -
Added a
Locatortypedef and an extension on [BuildContext], to help with being able to read providers from a class that doesn't depend on Flutter.
-
-
4.1.0-dev07 Feb 2020 pre-releaseNothing published for this version
-
4.1.0-dev+106 Mar 2020 pre-releaseNothing published for this version
-
4.1.0-dev+209 Mar 2020 pre-releaseNothing published for this version
-
4.1.0-dev+311 Apr 2020 pre-releaseNothing published for this version
-
4.0.511 Apr 2020Release notes
Open source →- Improve error message when forgetting to pass a
childwhen using a provider outside ofMultiProvider(thanks to @felangel)
- Improve error message when forgetting to pass a
-
4.0.5+126 Apr 2020 -
4.0.412 Feb 2020Release notes
Open source →- Update the ProviderNotFoundException to remove outdated solution. (thanks @augustinreille)
-
4.0.305 Feb 2020Release notes
Open source →- improved error message when
Provider.ofis called without specifyinglisten: falseoutside of the widget tree.
- improved error message when
-
4.0.218 Jan 2020Release notes
Open source →- fix
Provider.ofreturning the previous value instead of the new value if called insidedidChangeDependencies. - fixed an issue where
updatewas unnecessarily called.
- fix
-
4.0.128 Dec 2019 -
4.0.022 Dec 2019Release notes
Open source →Selectornow deeply compares collections by default, and offers ashouldRebuildto customize the rebuild behavior.- renamed
ProviderNotFoundErrortoProviderNotFoundException. This allows callingProvider.ofinside atry/catchwithout triggering a warning. - update provider to work with Flutter 1.12.1
- The creation and listening of objects using providers is now performed lazily. This means that objects are created the first time the value is read instead of the first time the provider is mounted.
Theremoved by 4.0.0-hotfix. See https://github.com/rrousselGit/provider/issues/305listenargument ofProvider.ofis now automatically inferred. It is no longer necessary to passlisten: falsewhen callingProvider.ofoutside of the widget tree.- renamed
initialBuilder&builderof*ProxyProvidertocreate&update - renamed
builderof*Providertocreate - added a
*ProxyProvider0variant
-
4.0.0-hotfix.125 Dec 2019 pre-releaseRelease notes
Open source →-
removed the inference of the
listenflag ofProvider.ofin favor of an exception in debug mode iflistenis true when it shouldn't.This is because it caused a critical performance issue. See https://github.com/rrousselGit/provider/issues/305
-
-
4.0.0-dev26 Nov 2019 pre-releaseNothing published for this version
-
3.2.027 Nov 2019Release notes
Open source →- Deprecated "builder" of providers in favor to "create"
- Deprecated "initialBuilder"/"builder" of proxy providers in favor of respectively "create" and "update"
-
3.1.020 Aug 2019Release notes
Open source →-
Added
Selector, similar toConsumerbut can filter unneeded updates -
improved the overall documentation
-
fixed a bug where
ChangeNotifierProvider.valuedidn't update dependents when theChangeNotifierinstance changed. -
Consumercan now be used insideMultiProviderMultiProvider( providers: [ Provider(builder: (_) => Foo()), Consumer<Foo>( builder: (context, foo, child) => Provider.value(value: foo.bar, child: child), ) ], );
-
-
3.1.0+117 Oct 2019Nothing published for this version
-
3.0.007 Jun 2019Release notes
Open source →breaking (see the readme for migration steps)
Providernow throws if used with aListenable/Stream. This can be disabled by settingProvider.debugCheckInvalidValueTypetonull.- The default constructor of
StreamProviderhas now builds aStreaminstead ofStreamController. The previous behavior has been moved toStreamProvider.controller. - All
XXProvider.valueconstructors now usevalueas parameter name. - Added
FutureProvider, which takes a future and updates dependents when the future completes. - Providers can no longer be instantiated using
constconstructors.
non-breaking
- Added
ProxyProvider,ListenableProxyProvider, andChangeNotifierProxyProvider. These providers allows building values that depends on other providers, without loosing reactivity or manually handling the state. - Added
DelegateWidgetand a few related classes to help building custom providers. - Exposed the internal generic
InheritedWidgetto help building custom providers.
-
3.0.0+111 Jun 2019Nothing published for this version
-
2.0.112 May 2019Release notes
Open source →- fix a bug where
ListenableProvider.value/ChangeNotifierProvider.value/StreamProvider.value/ValueListenableProvider.valuesubscribed/unsubscribed to their respective object too often - fix a bug where
ListenableProvider.value/ChangeNotifierProvider.valuemay rebuild too often or skip some.
- fix a bug where
-
2.0.1+125 May 2019Nothing published for this version
-
2.0.003 May 2019Release notes
Open source →Consumernow takes an optionalchildargument for optimization purposes.- merged
ProviderandStatefulProvider - added a "builder" constructor to
ValueListenableProvider - normalized providers constructors such that the default constructor is a "builder",
and offer a
valuenamed constructor.
-
2.0.0+103 May 2019Nothing published for this version
-
2.0.0-dev10 Apr 2019 pre-releaseNothing published for this version