maxLength static method
Fails when the value is longer than length characters.
Implementation
static FormFieldValidator<String> maxLength(int length, [String? message]) =>
(value) => (value ?? '').length > length
? (message ?? 'Must be at most $length characters')
: null;