Home > Enterprise >  How to save checkmark on current language in Flutter with Easy localization?
How to save checkmark on current language in Flutter with Easy localization?

Time:08-03

I have a listView.builder inside my Language screen, and i want to save preferences when the language is selected, a checkmark will appear next to. Language localization work perfectly and also the listView with a radio button checkmark. but when i close the page and come back, the checkmark go back to default language even the current language is still the what user choose.

So, should i load the current language everytime the Language screen is open or should I use Shared preferences to store the checkmark position?

enter image description here

CodePudding user response:

You can use two options:

  1. Save it in Shared preferences.
  2. Save it in your database. This option is very good in the situation when you have a mobile app and web. Because it saves profile parameters globally.

Another option that I like is to simply use system locale parameters. If a user has English language on his phone my application is the same. But this option is not for web only for mobile applications.

  • Related