isValidPhone property
bool
get
isValidPhone
Extension to validate Phone number To use: '0980001000'.isValidPhone;
Implementation
bool get isValidPhone {
// r"^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$"
return RegExp(r"^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$").hasMatch(this);
}