onValidate method
override
onValidate is used to validate the given input by the user.
Implementation
@override
String? onValidate(
String? value,
String Function(String, {List<String>? params}) translator,
) {
if (mandatory) {
if (value == null || value.isEmpty) {
return translator('Field can not be empty');
}
if (value.length < 6) {
return translator('Field should be atleast 6 characters long');
}
}
return null;
}