maxLength method

FormFieldValidator<String> maxLength (
  1. int maxLength,
  2. {String message}
)

Implementation

static FormFieldValidator<String> maxLength(int maxLength, {String message}) {
  return (fieldValue) {
    if (Validator.maxLength(fieldValue, maxLength)) {
      return null;
    } else {
      return message ?? "Field must be of maximum length of $maxLength";
    }
  };
}