provider 4.0.4
provider: ^4.0.4 copied to clipboard
A mixture between dependency injection and state management, built with widgets for widgets.
4.0.4 #
- Update the ProviderNotFoundException to remove outdated solution. (thanks @augustinreille)
4.0.3 #
- improved error message when
Provider.ofis called without specifyinglisten: falseoutside of the widget tree.
4.0.2 #
- fix
Provider.ofreturning the previous value instead of the new value if called insidedidChangeDependencies. - fixed an issue where
updatewas unnecessarily called.
4.0.1 #
- stable release of 4.0.0-hotfix+1
- fix some typos
4.0.0-hotfix.1 #
-
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 #
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
3.2.0 #
- Deprecated "builder" of providers in favor to "create"
- Deprecated "initialBuilder"/"builder" of proxy providers in favor of respectively "create" and "update"
3.1.0 #
- 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.0.0 #
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.
2.0.1 #
- 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.
2.0.0 #
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.
1.6.1 #
Provider.of<T>now crashes with aProviderNotFoundExceptionwhen noProvider<T>are found in the ancestors of the context used.
1.6.0 #
- new:
ChangeNotifierProvider, similar to scoped_model that exposesChangeNotifersubclass and rebuilds dependents only whennotifyListenersis called. - new:
ValueListenableProvider, a provider that rebuilds whenever the value passed to aValueNotifierchange.
1.5.0 #
- new: Add
Consumerwith up to 6 parameters. - new:
MultiProvider, a provider that makes a tree of provider more readable - new:
StreamProvider, a stream that exposes to its descendants the current value of aStream.
1.4.0 #
- Reintroduced
StatefulProviderwith a modified prototype. The second argument ofvalueBuilderanddidChangeDependencieshave been removed. AndvalueBuilderis now called only once for the whole life-cycle ofStatefulProvider.
1.3.0 #
- Added
Consumer, useful when we need to both expose and consume a value simultaneously.
1.2.0 #
- Added:
HookProvider, aProviderthat creates its value from aHook. - Deprecated
StatefulProvider. Either make aStatefulWidgetor useHookProvider. - Integrated the widget inspector, so that
Providerwidget shows the current value.
1.1.1 #
- add
didChangeDependenciescallback to allow updating the value based on anInheritedWidget - add
updateShouldNotifymethod to bothProviderandStatefulProvider
1.1.0 #
onDisposehas been added toStatefulProviderBuildContextis now passed tovalueBuildercallback



