isValid static method
Implementation
static bool isValid(String rawInput, {required String countryCode}) {
final String code = dialCodeOf(countryCode);
final String national = nationalNumber(rawInput, countryCode: code);
if (national.length < nationalMinDigits || national.length > maxNationalDigits(code)) return false;
if (national.startsWith("0") && !significantLeadingZeroDialCodes.contains(code)) return false;
final List<int>? lengths = nationalDigitLengths[code];
return lengths == null || lengths.contains(national.length);
}