countryName static method

String? countryName(
  1. BuildContext context,
  2. String countryCode
)

Implementation

static String? countryName(BuildContext context, String countryCode) {
  final locale = Localizations.localeOf(context);
  switch (locale.languageCode) {
    case 'ar':
      return localizedCountriesAr[countryCode];
    case 'de':
      return localizedCountriesDe[countryCode];
    case 'en':
      return localizedCountriesEn[countryCode];
    case 'es':
      return localizedCountriesEs[countryCode];
    case 'fa':
      return localizedCountriesFa[countryCode];
    case 'fr':
      return localizedCountriesFr[countryCode];
    case 'hi':
      return localizedCountriesHi[countryCode];
    case 'it':
      return localizedCountriesIt[countryCode];
    case 'ja':
      return localizedCountriesJa[countryCode];
    case 'ko':
      return localizedCountriesKo[countryCode];
    case 'nl':
      return localizedCountriesNl[countryCode];
    case 'pl':
      return localizedCountriesPl[countryCode];
    case 'pt':
      if (locale.countryCode == 'BR') {
        return localizedCountriesPtBR[countryCode];
      }
      return localizedCountriesPt[countryCode];
    case 'ru':
      return localizedCountriesRu[countryCode];
    case 'sv':
      return localizedCountriesSv[countryCode];
    case 'tr':
      return localizedCountriesTr[countryCode];
    case 'zh':
      return localizedCountriesZh[countryCode];
  }
  return null;
}