getCountryByIsoCode static method

Country? getCountryByIsoCode(
  1. String isoCode
)

Retrieve a country by its ISO code.

Implementation

static Country? getCountryByIsoCode(String isoCode) {
  final index = countries.indexWhere((country) => country.isoCode == isoCode);
  if (index < 0) return null;
  return countries[index];
}