onValidate method
override
onValidate is used to validate the given input by the user.
Implementation
@override
String? onValidate(
String? value,
String validationMessage,
) {
if (mandatory) {
if (value == null || value.isEmpty) {
return validationMessage;
}
if (value.length < 6) {
return validationMessage;
}
}
return null;
}