maxLength static method

PrismValidator maxLength(
  1. int max, [
  2. String? message
])

Fails when the value is longer than max characters.

Implementation

static PrismValidator maxLength(int max, [String? message]) =>
    (value) => (value ?? '').length > max
    ? (message ?? 'Must be at most $max characters')
    : null;