getCountryByDialCode static method

Country? getCountryByDialCode(
  1. String dialCode
)

Retrieve a country by its dial code.

Implementation

static Country? getCountryByDialCode(String dialCode) {
  final index =
      countries.indexWhere((country) => country.dialCode == dialCode);
  if (index < 0) return null;
  return countries[index];
}