parse static method

Country parse(
  1. String country
)

Returns a single country if country matches a country code or name.

Throws an ArgumentError if no matching element is found.

Implementation

static Country parse(String country) {
  return tryParseCountryCode(country) ?? parseCountryName(country);
}