initAppLocalization static method

Of<AppLocalization> initAppLocalization()

This function is used to initialize appLocalization. This function is called both in KareeMaterialApp and KareeModule.initialize(). Because _appLocalization is marked as late and is called in two places, it's important to avoid LateInitializationError. Karee will surround it with a try-catch structure.

Implementation

static Of<AppLocalization> initAppLocalization() {
  try {
    return KareeInternationalization.appLocalization;
  } catch (e) {
    KareeInternationalization._appLocalization =
        Of.tag(AppLocalization(), KareeConstants.kApplicationLocalizationTag);
    return KareeInternationalization.appLocalization;
  }
}