must method
Creates a new rule, passing in an expression and a message and returning a boolean
Implementation
AbstractRuleBuilder must(
bool Function(dynamic dyn) validator, String? message,
{String? code}) {
rules.add(
(dynamic param) => ValidationResult(
hasError: !validator(param),
errors: <ValidationError>[
ValidationError(key: key, message: message ?? '', code: code ?? '')
],
),
);
return this;
}