Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
581 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...