call method
Validates whether a value is not in the specified items list.
This method checks if the input value is not contained in the provided items list.
If the value is found in the items list, an error message is generated
using the buildMessage method.
Parameters:
attribute: The identifier of the form attribute being validated.value: The value to be validated.
Returns:
A validation error message if the value is found in the items list,
or null if the value is valid.
Implementation
@override
String? call(String attribute, String value) {
if (value.isNotEmpty) {
if (items.contains(value)) {
return buildMessage(attribute, value, onExtra: (message) {
message = message.replaceAll(':items', items.toString());
return message;
});
}
}
return null;
}