localeResolutionCallback static method
Callback for locale resolution
Implementation
static Locale? localeResolutionCallback(
Locale? locale, Iterable<Locale> supportedLocales) {
if (locale != null) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
if (locale.countryCode == null) {
return supportedLocale;
} else if (supportedLocale.countryCode == locale.countryCode) {
return supportedLocale;
}
}
}
}
return defaultLocale;
}