findDeviceLocale static method
Implementation
static AppLocale findDeviceLocale([String? locale, bool? isStore]) {
final isStorePara = isStore ?? false;
final String deviceLocale =
locale ?? WidgetsBinding.instance.window.locale.toLanguageTag();
if (isStorePara) {
deviceLocaleStored = deviceLocale;
}
if (deviceLocale != null) {
final typedLocale = _selectLocale(deviceLocale);
if (typedLocale != null) {
return typedLocale;
}
}
return AppLocale.en;
}