notEmpty method
FieldValidator<String?, String>
notEmpty({
- MessageCallBack<
String> ? message, - bool allowWhiteSpace = true,
check if the value is not empty
Implementation
FieldValidator<String?, String> notEmpty({
MessageCallBack<String>? message,
bool allowWhiteSpace = true,
}) {
return this.required().next(
(messages, value) => (allowWhiteSpace ? value : value.trim()).isEmpty
? message?.call(messages, value) ?? messages.notEmpty
: null,
);
}