getCountryInfo function
Returns a CountryInfo by countryCode
, dialCode
or countryName
.
Implementation
CountryInfo? getCountryInfo(
{String? countryCode, int? dialCode, String? countryName}) {
if (countryCode != null) {
var e = allCountriesByCode[countryCode.trim().toUpperCase()];
if (e != null) return e;
}
if (dialCode != null) {
var e = allCountriesByDialCode[dialCode];
if (e != null) return e;
}
if (countryName != null) {
var e = allCountriesByName[countryName.trim().toLowerCase()];
if (e != null) return e;
}
return null;
}