lookupAppLocalizations function

AppLocalizations lookupAppLocalizations(
  1. Locale locale
)

Implementation

AppLocalizations lookupAppLocalizations(Locale locale) {
  switch (locale.languageCode) {
    case 'en':
      return AppLocalizationsEn();
    case 'zh':
      return AppLocalizationsZh();
    case 'fr':
      return AppLocalizationsFr();
  }

  throw FlutterError(
      'AppLocalizations.delegate failed to load unsupported locale "$locale". '
      'This is likely an issue with the localizations generation tool. '
      'Please file an issue on GitHub with a reproducible sample app and the '
      'gen-l10n configuration that was used.');
}