notEmpty method
Validates that the string is not empty (and not null).
Trims the value before checking. Alias of required for semantic clarity.
message is the error string shown when validation fails.
Returns this to allow method chaining.
Example:
final title = Field<String>('title')
.notEmpty(message: 'Título não pode ser vazio');
Implementation
Field<String> notEmpty({String message = '', bool exposed = false}) {
return addValidator(
message,
(val) => val == null || val.trim().isEmpty,
exposedMessage: exposed,
);
}