isEmergencyNumber method

bool isEmergencyNumber(
  1. String number,
  2. String regionCode
)

Returns true if the given number exactly matches an emergency service number in the given region.

This method takes into account cases where the number might contain formatting, but doesn't allow additional digits to be appended. Note that [isEmergencyNumber(number, region)] implies [connectsToEmergencyNumber(number, region)].

number the phone number to test regionCode the region where the phone number is being dialed returns whether the number exactly matches an emergency services number in the given region

Implementation

bool isEmergencyNumber(String number, String regionCode) {
  return _matchesEmergencyNumberHelper(
      number, regionCode, false /* doesn't allow prefix match */);
}