maxLength static method

FormFieldValidator<String> maxLength(
  1. int max, [
  2. String? message
])

Validates maximum character length.

Implementation

static FormFieldValidator<String> maxLength(int max, [String? message]) =>
    (value) => (value != null && value.length > max)
        ? (message ?? 'Must be no more than $max characters')
        : null;