isPhoneNumberOfUS property
bool
get
isPhoneNumberOfUS
Returns true if string is a valid US Phone Number
Implementation
bool get isPhoneNumberOfUS {
if (this == null) {
return false;
}
final pattern = RegExp(
r'^(\+1\s?)?(\()?([2-9][0-9]{2})(\))?[-.\s]?([2-9][0-9]{2})[-.\s]?([0-9]{4})$');
return pattern.hasMatch(this!);
}