validateMaxLength static method

bool validateMaxLength(
  1. String value,
  2. int maxLength
)

Validates if the value matches the max length using MaxLengthRule. Returns true if the value is within the max length, otherwise false. Example:

IstValidator.validateMaxLength("hello", 10); // true
IstValidator.validateMaxLength("helloooooo", 5); // false

Implementation

static bool validateMaxLength(String value, int maxLength) {
  return MaxLengthRule(maxLength).validate(value) == null;
}