hooks_riverpod
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
3.4.2
438K downloads/mo
#555 most downloaded on pub.dev
rrousselGit/riverpod
What this package is like to depend on
Last release 26 days ago
28 Jul 2026
Ships fairly regularly
a new release about every 5 weeks
Most releases are documented
notes for 79 of 91 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
136 releases · first in 2020
15 releases in the last 12 months
see the full history below
Release timeline
136 releases · May 2020 to Jul 2026Releases
latest 60 of 136-
3.4.228 Jul 2026Release notes
Open source →riverpod_annotation : 4.0.5 -> 4.0.6
riverpod_sqflite : 0.4.5 -> 0.4.6
riverpod_generator : 4.0.7 -> 4.0.8
flutter_riverpod : 3.4.1 -> 3.4.2
riverpod_lint : 3.1.7 -> 3.1.8
hooks_riverpod : 3.4.1 -> 3.4.2Release notes
Open source →Fix a different source of
markNeedsBuilderror. Those are tricky!Dependency changes
flutter_riverpodupgraded to3.4.2riverpodupgraded to3.4.2
-
3.4.126 Jul 2026Release notes
Open source →- Update devtool extension
Dependency changes
flutter_riverpodupgraded to3.4.1riverpodupgraded to3.4.1
-
3.3.210 Jun 2026Release notes
Open source →- Fixes assertion error when providers are unpaused.
- Fixes assertion error when invalidating a provider after an autoDispose provider schedules disposal. (thanks to @a1573595)
Dependency changes
flutter_riverpodupgraded to3.3.2riverpodupgraded to3.3.2
-
3.3.2-dev.206 May 2026 pre-releaseRelease notes
Open source →Dependency changes
flutter_riverpodupgraded to3.3.2-dev.2riverpodupgraded to3.3.2-dev.2
-
3.3.2-dev.103 May 2026 pre-releaseRelease notes
Open source →-
Devtool-only: Added
debugTrackProviderCreation, which can be set totrueto enable the Riverpod devtool to jump to the source of a provider. -
Added
Ref.onManualInvalidation()lifecycle method to listen for manual provider invalidations. This allows distinguishing between manual invalidations (viarefresh/invalidate/invalidateSelf) and automatic invalidations caused by dependency changes. Additionally, providers can now forward invalidations to other providers withinonManualInvalidationcallbacks, enabling patterns like:final sourceProvider = Provider<String>(...); final derivedProvider = Provider((ref) { final thing = ref.watch(sourceProvider); ref.onManualInvalidation(() { ref.invalidate(sourceProvider); }); return '$thing is derived!'; }); ref.invalidate(derivedProvider); // also invalidates sourceProvider!Which allows for users to invalidate only the providers they care about, while implementation details can be handled privately. (thanks to @TekExplorer)
-
Added
ProviderContainer.allProviders(), to obtain all providers accessible from said container. You can optionally specifyallProviders(family: myFamily)to only include providers from said family. -
Refactored internal scheduling mechanism to solve some markNeedsBuild error.
-
Removed
@internalforProviderFamily.new -
Added various life-cycles to
ProviderObserver -
Fix
.futureincorrectly notifying listeners even whenAsyncValuedoesn't change.
Dependency changes
flutter_riverpodupgraded to3.3.2-dev.1riverpodupgraded to3.3.2-dev.1
-
-
3.3.109 Mar 2026Nothing published for this version
-
3.3.009 Mar 2026Release notes
Open source →- Added
ChangeNotifierProvider(disposeNotifier: false), to disable the automatic disposal of the createdChangeNotifier. This enables simpler migration frompkg:providertopkg:riverpodwhen aChangeNotifieris reused between multiple providers.
- Added
-
3.2.103 Feb 2026Release notes
Open source →- Fixed a bug where resuming a paused provider could cause it to never notify its listener ever again.
Dependency changes
flutter_riverpodupgraded to3.2.1riverpodupgraded to3.2.1
-
3.2.017 Jan 2026Release notes
Open source →- Fix the IDE pausing on "markNeedsBuild" exceptions when checking "pause on all exceptions".
ConsumerWidget's now uses the TickerMode notifier instead of TickerMode.of to avoid unnecessary rebuilds when widgets are hidden (thanks to @Colton127)- Added missing
weakflags toWidgetRef.listen/listenManual - Added
Ref.isPausedto check if there are any active/non-paused listeners. - Deprecated
family.overrideWithin favour offamily.overrideWith2The behaviour is the same, but the callback now takes the argument as a parameter. In 4.0.0,overrideWith2will be renamed tooverrideWith. - Fix a regression that caused Notifiers to lose their state when one of their dependencies changed. (thanks to @yegair)
- Fixed
ref.mountedreturningtruefor stale refs after provider rebuild, causing race conditions in async providers. - Fixed a bug where providers with only weak listeners (
ref.listen(..., weak: true)) would incorrectly initialize during hot reload (thanks to @tguerin) - Fixes
selectAsyncsometimes throwing an exception when unsubscribed to.
Dependency changes
flutter_riverpodupgraded to3.2.0riverpodupgraded to3.2.0
-
3.1.026 Dec 2025Release notes
Open source →-
Added an alternative way to combine asynchronous providers. This can be done by using
AsyncValue.requireValueinsideFutureProvider/AsyncNotifierlike so:final sumProvider = FutureProvider((ref) { // Not async AsyncValue<int> a = ref.watch(aProvider); AsyncValue<int> b = ref.watch(bProvider); // The following is safe if used inside the init function of providers. return a.requireValue + b.requireValue; })This enables synchronously combining asynchronous providers.
-
Fixed a bug with scoping when specifying
dependencies: [...] -
Added
Override.origin. This enables knowing which provider is associated with an override. -
Fix a regression with
AsyncLoading.isRefreshing/isReloading
-
-
3.0.309 Oct 2025 -
3.0.207 Oct 2025 -
3.0.130 Sep 2025Release notes
Open source →ChangeNotifierProviderFamilyis now correctly accessible inpackage:flutter_riverpod/legacy.dartinstead of/misc.dart- Now supports Dart 3.7.0
-
3.0.010 Sep 2025Release notes
Open source →Finally, a stable release for Riverpod 3.0!
For the full changelog, check out https://riverpod.dev/docs/whats_new
-
3.0.0-dev.1809 Sep 2025 pre-releaseRelease notes
Open source →- A provider that is currently being retried is now flagged as "loading"
while the retry attempts complete.
Meaning that
ref.watch(provider.future)skips the intermediate error states. - Fix an issue with the internals of AsyncValue
ProviderObserveris now marked withbase- Fix provider rebuild order issue.
- Fix "Tried to refresh x multiple times in the same frame" incorrectly triggering.
- Removed
FamilyNotifierand variants, in favour ofNotifier. - Preserve persisted state if a provider throws.
provider.futurewill now skip offline-persisted state by default. This avoids awkward unexpected provider rebuild when chaining persisted providers.- Made
Mutation.callgeneric. This allows for better compatibility with generic-returning functions (thanks to @TekExplorer)
- A provider that is currently being retried is now flagged as "loading"
while the retry attempts complete.
Meaning that
-
3.0.0-dev.1701 Aug 2025 pre-releaseRelease notes
Open source →- Added
MutationState.isPending/isIdle/hasError/isSuccess - fixes various "pause" issues
- Bump minimum
metaversion - Added
AsyncValue.retrying, to check when a retry is scheduled or pending - Exposed the default retry implementation (
ProviderContainer.defaultRetry) - Offline's Storage now is
baseand requires overridingdeleteOutOfDate - Make AsyncValue.copyWithPrevious
@internal. This API was not meant to be public.
- Added
-
3.0.0-dev.1620 Jun 2025 pre-releaseRelease notes
Open source →- Reworked mutations to work without code-generation
- Added
Async/SyncProviderTransformerMixin. Those enable making customProviderListenables using a reasonably simple syntax. For instance, you could implement your ownprovider.select - Added
AsyncResult. This is an interface shared betweenAsyncDataandAsyncError, but notAsyncLoading. - Revert Notifier life-cycle change. They are once again preserved across rebuilds.
- Provider errors are now reported to the
ProviderContainer'sZoneinstead of whatever last used the provider. - Breaking: When a
ref.watch/ref.readrethrows an error, the error is now wrapped in aProviderException. - Use TickerMode instead of Visibility for pausing out-of-view widgets
- Reworked offline to simplify its usage
- Added widget test helper to find a
ProviderContainerin the widget tree:tester.container()(thanks to @Luckey-Elijah)
-
3.0.0-dev.1504 May 2025 pre-release -
3.0.0-dev.1402 May 2025 pre-releaseRelease notes
Open source →flutter_riverpodupgraded to3.0.0-dev.14riverpodupgraded to3.0.0-dev.14
-
3.0.0-dev.1301 May 2025 pre-releaseRelease notes
Open source →flutter_riverpodupgraded to3.0.0-dev.13riverpodupgraded to3.0.0-dev.13
-
3.0.0-dev.1230 Apr 2025 pre-releaseRelease notes
Open source →Say hello to Riverpod 3.0.0!
This major version is a transition version, to unblock the development of the project. It is quite possible that a 4.0.0 will be released relatively soon in the future, so keep that in mind when migrating.Here are some highlights about this version:
- Offline and mutation support, as experimental features
- Automatic retry support
- Pause/resume support
- Simplification of various aspects of the API (such as fusing
AutoDisposeNotifier/Notifier) - Added a
Ref.mountedto simplify dealing with provider disposal - Improved testing with the new
ProviderContainer.test()and the ability to mock a Notifier'sbuildmethod without mocking the whole object usingprovider.overrideWithBuild(...)
Note about experimental features:
Anything imported withpackage:riverpod/experimental/....dartare not stable features. They may be modified in breaking ways without a major version. Use with care!Full change list
- Breaking:
ChangeNotifierProvider,StateProviderandStateNotifierProviderare moved out ofpackage:hooks_riverpod/hooks_riverpod.darttopackage:hooks_riverpod/legacy.dart. - Failing providers are now automatically retried after a delay. The delay can be optionally configured.
- Allow using Ref synchronously after a provider has been invalidated. This avoids mounted exceptions when doing multiple operations in a quick succession.
- Breaking: All providers now use
==to compare previous/new values and filter updates. If you want to revert to the old behavior, you can overrideupdateShouldNotifyinside Notifiers. - Instead of
Provider.autoDispose()andProvider.autoDispose.family(), it is now possible to writeProvider(isAutoDispose: true)andProvider.family(isAutoDispose: true). - Breaking: ProviderListenable.addListener is deleted and now internal-only. A simpler alternative will be added in the future.
- Breaking: ProviderObserver methods have been updated to take a
ProviderObserverContextparameter. This replaces the oldprovider+containerparameters, and contains extra information. - Breaking: Removed all
Refsubclasses (suchFutureProviderRef). UseRefdirectly instead. ForFutureProviderRef.future, migrate to using anAsyncNotifier. - Breaking All ref and notifier methods besides "mounted" now throw if used after getting disposed.
- Breaking:
StateProviderandStateNotifierProviderare moved out ofpackage:flutter_riverpod/flutter_riverpod.darttopackage:flutter_riverpod/legacy.dart. - Breaking Some internal utils are no-longer exported.
- Breaking
AsyncValue.valuenow returnsnullduring errors. - Breaking removed
AsyncValue.valueOrNull(use.valueinstead). Stream/FutureProvider.overrideWithValuewas added back.- Breaking:
Notifierand variants are now recreated whenever the provider rebuilds. This enables usingRef.mountedto check dispose. - Breaking:
StreamProvidernow pauses itsStreamSubscriptionwhen the provider is not actively listened. - Breaking: Calling ref.watch multiple times calls ref.onListen every-times.
- Breaking: A provider is now considered "paused" if all
of its listeners are also paused. So if a provider
Ais watched only by a providerB, andBis currently unused, thenAwill be paused. - Breaking: When an asynchronous provider rebuilds, it doesn't immediately stops
listening to its previous providers. Instead, those subscriptions are removed when the rebuild completes.
This impacts how "auto-dispose" behaves. See https://github.com/rrousselGit/riverpod/issues/1253 - Fix
StreamProvidernot cancelling theStreamSubscriptionif the stream is never emitted any value. - All
Reflife-cycles (such asRef.onDispose) andNotifier.listenSelfnow return a function to remove the listener. - Added methods to
ProviderObserverfor listening to "mutations". Mutations are a new code-generation-only feature. See riverpod_generator's changelog for more information. - Added
Ref.listen(..., weak: true). When specifyingweak: true, the listener will not cause the provider to be initialized. This is useful when wanting to react to changes to a provider, but not trigger a network request if not necessary. AsyncValuenow has an optionalprogressfield. This can be set by providers to allow the UI to show a custom progress logic.- An error is now thrown when trying to override a provider twice in the same
ProviderContainer. - Disposing a
ProviderContainernow disposes of all of its subProviderContainerstoo. - Added
ProviderSubscription.pause()/.resume(). This enables temporarily stopping the subscription to a provider, without it possibly loosing its state when usingautoDispose. - Added
ProviderContainer.test(). This is a custom constructor for testing purpose. It is meant to replace thecreateContainerutility. - Added
NotifierProvider.overrideWithBuild, to overrideNotifier.buildwithout overriding methods of the notifier. Ref.mountedhas been added. It can now be used to check if a provider was disposed.- When a provider is rebuilt, a new
Refis now created. This avoids issues where an old build of a provider is still performing work. - Updated
AsyncValuedocumentations to use pattern matching. - Added support for
Ref/ProviderContainer.invalidate(provider, asReload: true) - Failing providers are now automatically retried after a delay. The delay can be optionally configured.
- Fixed a bug when overriding a specific provider of a
family, combined withdependencies: [family]
-
3.0.0-dev.327 Nov 2023 pre-releaseNothing published for this version
-
3.0.0-dev.220 Nov 2023 pre-releaseNothing published for this version
-
3.0.0-dev.120 Nov 2023 pre-releaseNothing published for this version
-
3.0.0-dev.029 Oct 2023 pre-releaseNothing published for this version
-
2.6.122 Oct 2024Release notes
Open source →- Added
AsyncNotifier.listenSelf. It was mistakenly absent from the 2.6.0 release
- Added
-
2.6.020 Oct 2024Release notes
Open source →- Deprecated all
Refsubclasses. Instead, useRefitself. - Deprecated
Ref's type argument. UseRefwithout its generic parameter instead. - Deprecated any
Refmember that usedRef's generic (such asRef.stateorRef.listenSelf). Instead, use aNotifier. - Added
Notifier.listenSelf, as a replacement toRef.listenSelf. Ref.watchand other methods now accept auto-dispose providers too.
- Deprecated all
-
2.5.412 Oct 2024Nothing published for this version
-
2.5.218 Aug 2024 -
2.5.110 Mar 2024Release notes
Open source →- Deprecate
ProviderScope.parentdue to fundamentally not working. See https://github.com/rrousselGit/riverpod/issues/3261 - Improved
Provider(dependencies: [...])documentation. - Fix out of date
pub.devdescription ref.invalidatenow correctly clear all resources associated with the provider if the provider is no-longer used.- Fix
selectAsyncsometimes never resolving. - Fix
ProviderSubscription.readreturned byref.listen(provider.future)not throwing if used after the subscription has been closed. - Fix
ref.onAddListenerand other life-cycles not being triggered when listening toprovider.future/provider.notifier. - Fix a bug that caused
Assertion failed: _lastFuture == null
- Deprecate
-
2.4.1003 Feb 2024Release notes
Open source →- Fix out of date
pub.devdescription - Add
testargument toAsyncValue.guardmethod. (thanks to @utamori)
- Fix out of date
-
2.4.926 Nov 2023Release notes
Open source →- Fix "pending timer" issue inside tests when using
ref.keepAlive(). - Fix
Ref.invalidate/Ref.refreshnot throwing on circular dependency. - Fix an infinite loop caused by
ref.keepAliveif theKeepAliveLinkis immediately closed. - Fix
container.exists(provider)on nested containers not checking their parent containers.
- Fix "pending timer" issue inside tests when using
-
2.4.820 Nov 2023Release notes
Open source →Fix exceptions when using multiple root
ProviderContainers/ProviderScopes. -
2.4.720 Nov 2023Release notes
Open source →- Fix
ProviderObserver.didUpdateProviderbeing called with an incorrect "provider" parameter when the provider is overridden.
- Fix
-
2.4.613 Nov 2023Release notes
Open source →- Exceptions in asynchronous providers are now correctly received
by
ProviderObserver.providerDidFail. - Fix exception when a
ProviderScopeis rebuilt with a differentkey.
- Exceptions in asynchronous providers are now correctly received
by
-
2.4.528 Oct 2023 -
2.4.415 Oct 2023 -
2.4.305 Oct 2023 -
2.4.202 Oct 2023 -
2.4.127 Sep 2023 -
2.4.004 Sep 2023 -
2.3.1028 Aug 2023 -
2.3.928 Aug 2023Release notes
Open source →- Fix some exceptions causing Flutter asking to demangle stacktraces (#1874)
- Fix out of date
AsyncValuedocs.
-
2.3.816 Aug 2023Release notes
Open source →- Added support for state_notifier 1.0.0
Notifier.stateis now accessible inside tests
-
2.3.725 Jul 2023 -
2.3.624 Apr 2023Release notes
Open source →- Improved error message for missing
dependencies(thanks to @ValentinVignal) - Fixed various typos in the documentation (thanks to @ValentinVignal)
- Fix not disposing autoDispose family providers
- Removed incorrect statement in ChangeNotifierProvider docs
- Improved error message for missing
-
2.3.518 Apr 2023 -
2.3.407 Apr 2023 -
2.3.306 Apr 2023Release notes
Open source →- The debugger no-longer pauses on uncaught exceptions inside providers. This was voluntary, but too many people have complained that it often is a false positive.
- Removed unused dependency (thanks to @passsy)
-
2.3.213 Mar 2023Release notes
Open source →- Deprecated the generic parameter of
Family. This will enable implementing generic providers inriverpod_generatoronce it is removed. - Updated documentation
- Deprecated the generic parameter of
-
2.3.109 Mar 2023 -
2.3.028 Feb 2023Release notes
Open source →-
Added
StreamNotifier+StreamNotifierProvider. This is for building aStreamProviderwhile exposing ways to modify the stream.It is primarily meant to be used using code-generation via riverpod_generator, by writing:
@riverpod class Example extends _$Example { @override Stream<Model> build() { // TODO return some stream } } -
Deprecated
StreamProvider.streamInstead of:ref.watch(provider.stream).listen(...)do:
ref.listen(provider, (_, value) {...});Instead of:
final a = StreamProvider((ref) { return ref.watch(b.stream).map((e) => Model(e)); })Do:
final a = FutureProvider((ref) async { final e = await ref.watch(b.future); return Model(e); }) -
Some restrictions on the
dependenciesparameter of providers have been lifted. It is no-longer necessary to include providers which do not themselves specifydependencies. All providers should specifydependenciesif they are scoped at any point. -
Annotated
Notifier.statesetter as protected.
-
-
2.2.012 Feb 2023Release notes
Open source →- Improve type-inference when using
AsyncValue.whenOrNull(thanks to @AhmedLSayed9) - Fixed AsyncValue.asError incorrectly not preserving the generic type
- Internal refactoring for riverpod_generator
- Improve type-inference when using
-
2.1.325 Dec 2022 -
2.1.224 Dec 2022Release notes
Open source →- It is now correctly possible to use
ProviderSubscriptions insideConsumerState.dispose(thanks to @1980) - Update dependencies.
- fixes an exception on newer Dart versions
- fixes an edge-case where
FutureProvider/AsyncNotifierdid not emit the new state when the createdFuturecompleted (#1997) - fixes errors inside FutureProvider/AsyncNotifier/StreamProvider not preserving the previous state (if any).
- Update dependencies.
- It is now correctly possible to use
-
2.1.101 Nov 2022 -
2.1.031 Oct 2022Release notes
Open source →A small release adding missing utilities and fixing some web related issues.
-
Added
provider.overrideWith((ref) => state) -
Added
FutureProviderRef.future. -
Deprecated
StateProvider.stateInstead, use eitherref.watch(stateProvider)orref.read(stateProvider.notifier).state = -
Deprecated
provider.overrideWithProvider. Instead useprovider.overrideWith -
Added
Ref.notifyListeners()to forcibly notify dependents. This can be useful for mutable state. -
Added
@useResulttoRef.refresh/WidgetRef.refresh -
Added
Ref.existsto check whether a provider is initialized or not. -
FutureProvider,StreamProviderandAsyncNotifierProvidernow preserve the previous data/error when going back to loading. This is done by allowingAsyncLoadingto optionally contain a value/error. -
Added
AsyncValue.when(skipLoadingOnReload: bool, skipLoadingOnRefresh: bool, skipError: bool)flags to give fine control over whether the UI should showloadingordata/errorcases. -
Add
AsyncValue.requireValue, to forcibly obtain thevalueand throw if in loading/error state -
Doing
ref.watch(futureProvider.future)can no-longer return aSynchronousFuture. That behavior could break variousFutureutilities, such asFuture.wait -
Add
AsyncValue.copyWithPrevious(..., isRefresh: false)to differentiate rebuilds fromref.watchvs rebuilds fromref.refresh. -
ProviderContainer no-longer throws when disposed if it has an undisposed child ProviderContainer.
-
Improved the error message when trying to modify a provider inside a widget life-cycle.
-
Fixes a stackoverflow on Web caused by Dart (thanks to @leehack)
-
Fixes a bug when the root ProviderContainer is not associated with a ProviderScope.
-
Fixes a case where a circular dependency between providers was incorrectly allowed (#1766)
-
-
2.0.203 Oct 2022Release notes
Open source →- FIX: Fixed an assert error if a
familydepends on itself while specifyingdependencies. (#1721).
2.0.2
Fixed an assert error if a
familydepends on itself while specifyingdependencies.2.0.1
Updated changelog (see 2.0.0)
2.0.0
Here is the changelog for all the changes in the 2.0 version. An article is in progress and will be linked here once available.
Breaking changes:
FutureProvider.streamis removed.- Using
overrideWithProvider, it is no-longer possible to override a provider with a different type of provider (such as overridingFutureProviderwith aStreamProvider). AsyncError.stackTraceis now a required positional parameter and non-nullable- All
overrideWithValuemethods are removed, besidesProvider.overrideWithValue. This change is temporary, and these methods will be reintroduced in a later version. In the meantime, you can useoverrideWithProvider. - Modifiers (
provider.future,provider.state, ...) no-longer are providers, and therefore no-longer appear insideProviderObserver. - The
Readertypedef is removed. UseRefinstead. ProviderListeneris removed. Usedref.listeninstead.- Removed the deprecated
ProviderReference. - Providers no-longer throw a
ProviderExceptionif an exception was thrown while building their value. Instead, they will rethrow the thrown exception and its stacktrace. - It is no longer possible to pass
provider.future/.notifier/...to the parameterdependenciesof provider. Passing the provider directly is enough. - The
Familytype now has a single generic parameter instead of 3.
Non-breaking changes:
- Upgrade minimum required Flutter SDK version to 3.0.0
- Upgrade minimum required Dart SDK version to 2.17.0
- Added
WidgetRef.context. This allows functions that depend on aWidgetRefto use theBuildContextwithout having to receive it as parameter. - Added
provider.selectAsync, which allows to both await an async value while also filtering rebuilds. - Added
WidgetRef.listenManualfor listening to providers in a widget outside ofbuild. - Added
ref.listenSelf, for subscribing to changes of a provider within that provider. That can be useful for logging purposes or storing the state of a provider in a DB. - Added
container.invalidate(provider)/ref.invalidate(provider)andref.invalidateSelf(). These are similar toref.refreshmethods, but do not immediately rebuild the provider.
These methods are safer than
ref.refreshas they can avoid a provider rebuilding twice in a quick succession.-
Added
ref.onAddListener,ref.onRemoveListener,ref.onCancelandref.onResume. All of which allow performing side-effects when providers are listened or stop being listened. -
A new
AutoDisposeRef.keepAlive()function is added. It is meant to replaceAutoDisposeRef.maintainStateto make logic for preventing the disposal of a provider more reusable. -
feat;
AutoDisposeRef.maintainStateis deprecated. Use the newAutoDisposeRef.keepAlive()instead. -
Add support for
ref.invalidate(family)to recompute an entire family (#1517) -
Added
AsyncValue.valueOrNullto obtain the value while ignoring potential errors. -
Added new functionalities to
AsyncValue:hasError,hasData,asError,isLoading,copyWithPreviousandunwrapPrevious.
Fixes:
- fixed a bug where
AsyncValue.whenDatadid not preserveAsyncValue.isLoading/isRefreshing StateProviderandStateNotifierProviderno longer notify their listeners onref.refreshif the new result is identical to the old one.- fixed potential null exception when using
autoDispose - fixed a bug where unmounting a nested ProviderScope could cause an exception (#1400)
- Fixed an issue where providers were incorrectly allowed to depend on themselves,
breaking
autoDisposein the process. - Fixed a memory leak when using
StateProvider.autoDispose's.state - Fix
ProviderObserver.didDisposeProvidernot executing on provider refresh. - Fixed an issue where
AsyncValue.valuedid not throw if there is an error. - Fixed a cast error when overriding a provider with a more specific provider type (#1100)
- Fixed a bug where
onDisposelisteners could be executed twice under certain conditions when usingautoDispose. - Fixed an issue where refreshing a
provider.future/provider.streamdid work properly - Fixed false positive with
ref.watchasserts
2.0.0-dev.9
Fix Timer leak when using
cacheTime/disposeDelayand disposing aProviderContainer2.0.0-dev.8
fix: a bug where unmounting a nested ProviderScope could cause an exception (#1400)
2.0.0-dev.7
- Upgrade minimum required Dart SDK version to 2.17.0
- Upgrade minimum required Flutter SDK version to 3.0.0
2.0.0-dev.6
- Added
WidgetRef.listenManualfor listening to providers in a widget outside ofbuild. - Added
AsyncValue.valueOrNullto obtain the value while ignoring potential errors. - Fixed an issue where
AsyncValue.valuedid not throw if there is an error. - Fix families not applying cacheTime/disposeDelay
- Fixed a bug where an exception may be thrown asynchronously after a
KeepAliveLinkis cancelled.
2.0.0-dev.5
- Fixed a bug where emitting an
AsyncDataafter anAsyncErrorleads toAsyncValue.hasErrorto be true
2.0.0-dev.4
-
Added
ProviderScope.parent, a property used for manually overriding a scope's parent. This is useful for allowing modals/dialogs to access scoped providers -
Added
ref.listenSelf, for subscribing to changes of a provider within that provider. That can be useful for logging purposes or storing the state of a provider in a DB. -
Added
disposeDelayto allautoDisposeproviders and toProviderContainer/ProviderScope. This configures the amount of time before a provider is disposed when it is not listened. -
Added
container.invalidate(provider)/ref.invalidate(provider)andref.invalidateSelf(). These are similar toref.refreshmethods, but do not immediately rebuild the provider.These methods are safer than
ref.refreshas they can avoid a provider rebuilding twice in a quick succession. -
The duration passed to
cacheTimenow represents the minimum amount of time after the latest change of a provider, instead of the first time a provider built. -
Fixed an issue where providers were incorrectly allowed to depend on themselves, breaking
autoDisposein the process. -
Fixed a memory leak when using
StateProvider.autoDispose's.state -
Fix
ProviderObserver.didDisposeProvidernot executing on provider refresh.
2.0.0-dev.3
When calling
ref.listenon a provider, this provider will now properly rebuild if one of its dependency had changed.2.0.0-dev.2
-
Deprecated
ref.maintainState=in favor of a newly addedref.keepAlive(). This newref.keepAlive()function is similar tomaintainStatebut better handles cases where we have multiple logics that want to keep the state of a provider alive for some period of time. -
Removed the deprecated
ProviderReference. -
Added
ProviderContainer.cacheTimeandMyProvider.autoDispose(..., cacheTime: duration).cacheTimeis used to keep anautoDisposeprovider alive for at least a minimum amount of time before it gets disposed if not listened. -
Added
ref.onAddListener,ref.onRemoveListener,ref.onCancelandref.onResume. All of which allow performing side-effects when providers are listened or stop being listened.
2.0.0-dev.1
-
Now requires Dart 2.16
-
Breaking Providers no-longer throw a
ProviderExceptionif an exception was thrown while building their value. Instead, they will rethrow the thrown exception and its stacktrace. -
Removed
AsyncValue'sisError/isData -
Added new functionalities to
AsyncValue:hasError,hasData,copyWithPrevious -
Added
provider.selectAsync, which allows to both await an async value while also filtering rebuilds. -
When a provider emits an
AsyncErrorfollowed by anAsyncData, theAsyncDataemitted will now contain the latest error/stackTrace too. -
Fixed a cast error when overriding a provider with a more specific provider type (#1100)
-
Fixed a bug where
onDisposelisteners could be executed twice under certain conditions when usingautoDispose.
2.0.0-dev.0
-
Breaking After a provider has emitted an
AsyncValue.dataorAsyncValue.error, that provider will no longer emit anAsyncValue.loading. Instead, it will re-emit the latest value, but with the propertyAsyncValue.isRefreshingto true.This allows the UI to keep showing the previous data/error when a provider is being refreshed.
-
Adding
isLoading,isError,isDataandasErrortoAsyncValue. Those getters allow interacting withAsyncValuewithout having to rely on pattern matching. -
Fixed an issue where refreshing a
provider.future/provider.streamdid work properly -
Fixed false positive with
ref.watchasserts
- FIX: Fixed an assert error if a
-
2.0.102 Oct 2022Nothing published for this version
-
2.0.030 Sep 2022Nothing published for this version