maxLength static method

ValidationRule maxLength(
  1. int length, {
  2. String? message,
})

Implementation

static ValidationRule maxLength(int length, {String? message}) {
  return ValidationRule(
    (value) => value != null && value.length <= length ? null : '',
    message ?? 'Must not exceed $length characters',
  );
}