validateOne method
Validates a single item using the provided validator function.
Returns true if the item is valid, false otherwise.
Implementation
bool validateOne(int index, String? Function(int index) validator) {
final error = validator(index);
setError(index, error);
return error == null || error.isEmpty;
}