getCountryByIso3Code static method

Country getCountryByIso3Code(
  1. String iso3Code
)

Implementation

static Country getCountryByIso3Code(String iso3Code) {
  try {
    return countryList.firstWhere(
      (country) => country.iso3Code.toLowerCase() == iso3Code.toLowerCase(),
    );
  } catch (error) {
    throw Exception("The initialValue provided is not a supported iso 3 code!");
  }
}