Issue
I have been fluttering about a month. Still wrapping my head around it all.
Going forward I want to use Provider for state management. Will this mean I can then avoid using:
- setState, and
- stateful widgets?
Thanks!
Solution
No, it does not mean the Provider can replace stateful widget.
While deciding between stateful widget and Provider, think about this.
- Is is state related to only this component and required by no other component (eg: text inputs from form,..) then use the stateful widget.
- Is is the state required by other components in the widget tree? (eg: user authentication state, database connection, …)then you can go for Provider.
Answered By – Sanketh B. K
Answer Checked By – Timothy Miller (FlutterFixes Admin)