What is the best way to get user's preference


#1

Hi, I am curious about what is the best way to get user’s preference throughout the app.

I want to achieve this result, the user can change language, and currency in their setting page. but in my code, which is a better way to change the whole apps for them.

  1. provider
  2. local storage
  3. (any more you can think of?) :slight_smile:

#2

These are orthogonal and should be used for different goals. Providers should be used to communicate throughout a single app run; whereas storage is designed for preserving information from run to run, i.e. across when the app is closed and restarted.


#3

Thanks, I think I will use provider for some setting I want to preserve, and save those setting to database. and I will use local storage like some filter option, which only for one run.


#4

Sorry, but that’s exactly backwards from what I’m recommending.