Replies: 2 comments
-
This is the goal of StateNotifier/StateNotifierProvider I'd discourage trying to use StateProvider at large scale. It's lacking the organization that StateNotifierProvider provides |
Beta Was this translation helpful? Give feedback.
-
I understand, but I was thinking that, if I want, for example, something very simple like a class to store some filter properties which change based on some inputs. I could create a StateProvider with a FilterClass and just change that filter class for this use case. With StateNotifier you have to create a StateNotifier class just to create some simple setters. Also, I don't know if this is the right place to ask you, but, regarding the StateProvider, are |
Beta Was this translation helpful? Give feedback.
-
I know using StateNotifier you can update the state by calling functions.
I was wondering if there is any way to update a StateProvider state by calling functions. StateNotifier seems overkill sometimes, just for some simple value assignments.
For example:
And on a Button callback, instead of doing
I would do
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions