maxDigits<E> static method
Validates that the phone number has at most max digits.
PhoneRules.maxDigits(15, error: 'Phone number too long')
Implementation
static Rule<String, E> maxDigits<E>(int max, {required E error}) =>
PredicateRule(
predicate: (value) {
final digits = value.replaceAll(RegExp(r'\D'), '');
return digits.length <= max;
},
error: error,
);