tryParse static method

Country? tryParse(
  1. String country
)

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

returns null if no matching element is found.

Implementation

static Country? tryParse(String country) {
  return tryParseCountryCode(country) ?? tryParseCountryName(country);
}