maxLength static method

Validator maxLength(
  1. int maxLength, [
  2. String? text
])

Implementation

static Validator maxLength(int maxLength, [String? text]) {
  return (String? value) {
    if ((value?.length ?? 0) > maxLength) {
      return text ?? "Maximum of $minLength characters allowed.";
    }
    return null;
  };
}