observeLocale property
void Function({required Locale newLocale, required Locale oldLocale})
observeLocale
getter/setter pair
This global callback is called whenever the locale changes. Notes:
• To obtain the language, you can do:
String language = I18n.getLanguage(newLocale);
• To obtain the normalized locale as a string, you can do:
String localeStr = I18n.trim(newLocale);
Implementation
static void Function({
required Locale oldLocale,
required Locale newLocale,
}) observeLocale = ({required Locale oldLocale, required Locale newLocale}) {};