findByDialCode static method

Country? findByDialCode(
  1. String code
)

Implementation

static Country? findByDialCode(String code) {
  return _list.firstWhere(
    (country) => country.dialCode == code,
    orElse: () {
      throw Exception('Invalid dial code: $code');
    },
  );
}