maxLength method

AbstractRuleBuilder maxLength(
  1. int max, {
  2. String? message,
})

Checks if the object is a String and is at below a maximum length

Implementation

AbstractRuleBuilder maxLength(int max, {String? message}) {
  return must((dynamic dyn) => dyn is String && dyn.length <= max, message ?? "String must be less than or equal to $max characters long", code: "notMaxLength");
}