getCountryByPhoneCode static method

Country? getCountryByPhoneCode(
  1. String? phoneCode
)

Implementation

static Country? getCountryByPhoneCode(String? phoneCode) {
  try {
    return countryList.firstWhere(
      (country) =>
          country.phoneCode.toLowerCase() == phoneCode?.toLowerCase(),
    );
  } catch (error) {
    return null;
  }
}