multiple static method
Creates a validator that if the combination of multiple validators.
The provided validators are applied in the order in which they're specified in the list.
Implementation
static Validator multiple(List<Validator> validators, {bool shouldTrim = true}) {
return (String? value) {
value = shouldTrim ? value?.trim() : value;
for (Validator validator in validators) {
if (validator(value) != null) {
return validator(value);
}
}
return null;
};
}