getCountryByDialCode method

Country getCountryByDialCode(
  1. String dialCode
)

Implementation

Country getCountryByDialCode(String dialCode) {
  return getCountries.firstWhere(
      (country) => country.dialCode.replaceFirst('+', '') == dialCode,
      orElse: () {
    if (_onUnsupportedCountrySelected != null) {
      _onUnsupportedCountrySelected!(dialCode);
    }
    return _selectedCountry;
  });
}