phone static method
Phone number
Implementation
static String? phone(String? value, [String? message]) {
if (value == null || value.isEmpty) return null;
final regex = RegExp(r'^\+?[\d\s\-\(\)]{9,}$');
if (!regex.hasMatch(value)) {
return message ?? 'Please enter a valid phone number';
}
return null;
}