isValidPhoneNumber property
bool
get
isValidPhoneNumber
Validates if the string is a valid phone number.
Example: Supports formats with or without +
, and 10-15 digits.
Implementation
bool get isValidPhoneNumber {
return RegExp(r'^(\+?\d{1,3})?[\d]{10,15}$').hasMatch(this);
}