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