Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
577 views
in Technique[技术] by (71.8m points)

redux - Flutter state management without BLoC

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...