onValidate method
Returns the validation message by the child class extending Rule.
Override it in the child class to define the validation logic for it.
Implementation
@override
String? onValidate(String entityName, T? value) {
if (value == null ||
isEmptyIterable(value) ||
isEmptyMap(value) ||
isEmptyString(value)) {
return ':entity is required.';
}
return null;
}