changeLocale method

void changeLocale(
  1. Locale newLocale
)

Implementation

void changeLocale(Locale newLocale) {
  emit(LocalizationState(
      newLocale,
      state.translations.containsKey(newLocale.languageCode)
          ? state.translations
          : {
              fallbackLocale.languageCode:
                  state.translations[fallbackLocale.languageCode] ?? {}
            }));
}