my question is about what approach to choose for app state management. Many walktrough talks about BLoC, RxDart, Redux etc. My aim is to develop a simple app that download sometimes data from a server and keep using local storage (SQL in flutter) to handle the data (CRUD operations). Other involve few user data handled by shared preferences. I don't need high performance / super asynchronous stream of data from a server(as shown in 90% of tutoral of BLoC logic). Is truly neecessary to have an app state pattern and what can the best approach for my case?
3 Answers
You can use the approach of Stateful Widgets, and do your process (in case you do not need a app with a high performance), but the best approach I would suggest is to use PROVIDERS, they are easy to implement, You can take care of the downloading process and the saving also in a easier and cleaner manner, the App will perform very well, and also works well with Stateless widgets (you can rebuild only the necessary parts in a complex widget tree).
But have your own research, and find out which will suit your App the best, Happy Coding :)
My suggestion is to try to use a mix between Provider and BLoC, instead of using RxDart, Redux which requires too much boilerplate code and it is more used to manage streams.
The provider will allow you to share information between your widget tree, in an organized way and BLoC will help you to separate your logic from your UI, the best practice to grow in time.
I suggest content from this channel: https://codewithandrea.com/tags/provider/ He helps and provides good resources to implement an easy and understandable architecture background.
Yes, BLoC, RxDart, Redux are good enough. But we should choose the things on our requirement and here in this project, there is no need to use any three of these.
For state-management, you can use the provider package as this suits best to your requirement, and it's easy to use and implement
A very simple example to implement it is here