getInitialSelectedCountry static method
Returns a Country form list of countries
passed that matches countryCode
.
Returns the first Country in the list if no match is available.
Implementation
static Country getInitialSelectedCountry(
List<Country> countries, String countryCode) {
return countries.firstWhere((country) => country.alpha2Code == countryCode,
orElse: () => countries[0]);
}