maxLength<T> static method

FormFieldValidator<T> maxLength<T>(
  1. int maxLength, {
  2. String? errorText,
  3. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the length of the field's value to be less than or equal to the provided maximum length.

Parameters:

  • maxLength The maximum length to compare.
  • errorText The error message when the length is invalid.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<T> maxLength<T>(
  int maxLength, {
  String? errorText,
  bool checkNullOrEmpty = true,
}) => MaxLengthValidator<T>(
  maxLength,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;