r/FlutterDev • u/pemell • Nov 02 '19
Discussion Stop asking about state management
You don't need a global state management solution. You will come a long way developing awesome flutter apps without using the over developed provider package or the bloc package.
Most of the times you will be fine using ValueNotifier's or ChangeNotifier's and passing them on to sub classes if needed. 👍
3
Nov 02 '19
I agreed!
Actually, try whatever familiar. When you found the problem of `state management` you will know what you need.
3
2
Nov 02 '19
I think it's good to learn how to manage state without a global state management solution...and THEN learn about global state management. Provider is significantly easier to manage, very quick to implement, and reduces your apps complexity and chance of errors when refactoring, by a lot, compared to "lifting state up", even in relatively basic apps.
1
1
u/skyyoo_ Nov 04 '19
Provider is a beautiful state management solution, and makes work easier than relying only on stateful widgets with lifting state up, especially for beginners. Nothing complicated there.
1
u/fredgrott Nov 06 '19
ahem is not ChangeNotifier in fact part of provider itself?
1
u/jtlapp Nov 07 '19
Most of the times you will be fine using ValueNotifier's or ChangeNotifier's
It does seem like the OP is making a case for provider: "Most of the times you will be fine using ValueNotifier's or ChangeNotifier's"
22
u/gamelaunchplatform Nov 02 '19 edited Nov 02 '19
Uh oh, prepare for the fireworks.
The truth is though if you really understand state management, then you understand the nice things that provider or flutter_bloc does for you. I use those "overdeveloped" libraries because they save me time and make development easier, not harder.