getCountryByIso3Code static method

Country? getCountryByIso3Code(
  1. String? iso3Code
)

Implementation

static Country? getCountryByIso3Code(String? iso3Code) {
  try {
    if (iso3Code?.isEmpty != false) {
      return null;
    }
    return countryList.firstWhere(
          (country) =>
      country.iso3Code.toLowerCase() == iso3Code?.toLowerCase(),
    );
  } catch (error) {
    return null;
  }
}