tryParsePhoneCode static method

Country? tryParsePhoneCode(
  1. String phoneCode
)

Returns a single country that matches the given phoneCode (e164_cc).

Returns null if no matching element is found.

Implementation

static Country? tryParsePhoneCode(String phoneCode) {
  try {
    return parsePhoneCode(phoneCode);
  } catch (_) {
    return null;
  }
}