call method

  1. @override
String? call(
  1. String attribute,
  2. String value
)
override

Validates whether a value is required and non-empty.

This method checks if the input value is empty (blank or null). If the value is empty, 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 empty, or null if the value is not empty.

Implementation

@override
String? call(String attribute, String value) {
  if (value.isEmpty) {
    return buildMessage(attribute, value);
  }
  return null;
}