This repository was archived by the owner on Mar 8, 2022. It is now read-only.
Update dependency provider to v6 #20
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.0.0
->6.0.2
Release Notes
rrousselGit/provider
v6.0.2
Added error details for provider that threw during the creation (thanks to @jmewes)
v6.0.1
Removed the assert that prevented from using
ChangeNotifierProvider
with notifiers that already had listeners.
v6.0.0
Compare Source
Breaking: It is no longer possible to define providers where their
only difference is the nullability of the exposed value:
Before, when defining those providers, doing
context.watch<Model>
vs
context.watch<Model?>
would point to a different provider.Now, both will always point to the deepest provider (in this example
Provider<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?>
,as
Model?
is not a valid syntax. With this change, this is now feasible.It is now possible to read a provider without throwing a
ProviderNotFoundException
if the provider is optional.
To do so, when calling
context.watch
/context.read
, make the generic typenullable. Such that instead of:
which will throw a
ProviderNotFoundException
if no matching providers are found,do:
which will try to obtain a matching provider. But if none are found,
null
will be returned instead of throwing.Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.