length method
Checks if the object is a String and is inbetween two lengthes
Implementation
AbstractRuleBuilder length(int min, int max, {String? message}) {
return must(
(dynamic dyn) =>
dyn is String && dyn.length >= min && dyn.length <= max,
message != null
? message
: useKeyAsElementName
? "$key must between $min and $max characters long"
: "String must between $min and $max characters long",
code: "notLength");
}