getAllCountryDatasByPhoneCode static method

List<PhoneCountryData> getAllCountryDatasByPhoneCode(
  1. String phoneCode
)

Implementation

static List<PhoneCountryData> getAllCountryDatasByPhoneCode(
  String phoneCode,
) {
  phoneCode = phoneCode.replaceAll('+', '');
  var list = <PhoneCountryData>[];
  _data.forEach((data) {
    var c = toNumericString(
      data['internalPhoneCode'],
      allowAllZeroes: true,
    );
    if (c == phoneCode) {
      list.add(PhoneCountryData.fromMap(data));
    }
  });
  return list;
}