getLocale static method

Future<Locale> getLocale()

Implementation

static Future<Locale> getLocale() async {
  final prefs = await SharedPreferences.getInstance();
  String? localeCode = prefs.getString(_localeKey);
  if (localeCode == null) {
    return const Locale('en');
  }
  return Locale(localeCode);
}