getCountryByName static method
Implementation
static Country getCountryByName(String name) {
try {
return countryList.firstWhere(
(country) => country.name.toLowerCase() == name.toLowerCase(),
);
} catch (error) {
throw Exception("The initialValue provided is not a supported name!");
}
}