call method
Implementation
@override
Object? call(String value) {
if (minLength != null && value.length < minLength!) {
return TextValidationError(
validation: this,
code: errorCode,
minLength: minLength,
);
} else if (maxLength != null && value.length > maxLength!) {
return TextValidationError(
validation: this,
code: errorCode,
maxLength: maxLength,
);
} else if (match != null && !match!.hasMatch(value)) {
return TextValidationError(
validation: this,
code: errorCode,
match: match?.pattern,
);
} else if (notMatch != null && notMatch!.hasMatch(value)) {
return TextValidationError(
validation: this,
code: errorCode,
notMatch: notMatch?.pattern,
);
}
return null;
}