phone static method

String? phone(
  1. String? value, {
  2. String message = 'Enter a valid phone number',
})

Validates a phone number.

Implementation

static String? phone(String? value,
    {String message = 'Enter a valid phone number'}) {
  if (value == null || value.trim().isEmpty) return null;
  return Validators.isPhone(value) ? null : message;
}