isValidPhone static method
Check if a String is a valid phone number
Implementation
static bool isValidPhone(String value) {
value = value.replaceAll(" ", '');
value = value.replaceAll("-", '');
value = value.replaceAll("+", '');
String pattern = r'(^(?:[+0]9)?[0-9]{10,12}$)';
bool valid = RegExp(pattern).hasMatch(value);
return valid;
}