-
-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make update() methods take a non-nullable previous #865
Comments
|
Maybe I am missing something. https://github.com/rrousselGit/provider/blob/master/packages/provider/lib/src/change_notifier_provider.dart#L106 With an optional
If |
You're right, in the few places where It's low priority for me though. |
Looks like it may not be easy to do in a clean way without a breaking change, because the |
You could always use |
Is your feature request related to a problem? Please describe.
The problem to be solved is that update() methods can't depend on create() having been called, so they have to duplicate code snippets with create. For example:
Describe the solution you'd like
Make
previous
non-nullable throughout the API and internally guarantee that create() (or .value or whatever) is called first.The text was updated successfully, but these errors were encountered: