isNotEmpty method Null safety
- {String message = "Validator.isNotEmpty"}
Returns a Validator that accepts a value that is not null or empty.
accepts:
"foo"
rejects:
null, "", " ",
Implementation
Validator isNotEmpty({
String message = "Validator.isNotEmpty",
}) {
return add(
(value) => value == null || value.trim().isEmpty ? message : null,
);
}