Different between shared preference and using redux

Viewed 405

What are the differences between SharedPreferences and Redux, especially in flutter? Redux provides a global state in app. So which is the most powerful of the two? What are the biggest important things that I should know about these 2 different things?

1 Answers

SharedPreferences and Redux are two very different things with different purposes all together.

Redux, as you said, allows you to share a global state across your app. But the data in that state/store is volatile. If you restart your app, the data will be gone. Its main purpose is to share data to any part of your app.

SharedPreferences works like a local storage on the device. It uses NSUserDefaults (on iOS) and SharedPreferences (on Android). It's meant to store key - value pairs. Small amounts of information that are kept even if your app is closed. It's not meant to be used as a DataBase. It's main purpose is typically to store tokens, small amounts of user data or any other bits that you may need.

Related