notEmpty method

FieldValidator<String?, String> notEmpty({
  1. MessageCallBack<String>? message,
  2. 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,
      );
}