Skip to main content

fetchLocale method

Future<void> fetchLocale ()

<p>This function fetch the language of the user's app.</p>

Implementation

Future\<void\> fetchLocale() async \{
final prefs = await SharedPreferences.getInstance();
final String langCode = prefs.getString('language_code') ?? 'en';
_appLocale = Locale(langCode);

notifyListeners();
\}