maxLength method
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 != null
? message
: useKeyAsElementName
? "$key must be less than or equal to $max characters long"
: "String must be less than or equal to $max characters long",
code: "notMaxLength");
}