phone static method

String? phone(
  1. String? value
)

Implementation

static String? phone(String? value) {
  if (value == null || value.trim().isEmpty) {
    return 'Phone number is required';
  }
  if (!_phoneRegex.hasMatch(value.trim())) {
    return 'Please enter a valid phone number';
  }
  return null;
}