tryParseCountryCode static method

Country? tryParseCountryCode(
  1. String countryCode
)

Returns a single country that matches the given countryCode (iso2_cc).

Returns null if no matching element is found.

Implementation

static Country? tryParseCountryCode(String countryCode) {
  try {
    return parseCountryCode(countryCode);
  } catch (_) {
    return null;
  }
}