getByName static method
Implementation
static CountryModel? getByName(String name,
{List<CountryModel>? allowedCountryList}) {
try {
return (allowedCountryList ?? countryList).firstWhere(
(country) => country.name.toLowerCase() == name.toLowerCase());
} catch (e) {
return null;
}
}