isValidPhone property

bool get isValidPhone

Strips formatting then checks for 7–15 digits (ITU-T E.164 range). Does NOT enforce country-specific formats — use a package like phone_numbers_parser when you need locale validation.

Implementation

bool get isValidPhone {
  final digits = replaceAll(RegExp(r'[\s\-().+]'), '');
  if (digits.isEmpty) return false;
  return RegExp(r'^\d{7,15}$').hasMatch(digits);
}