notEmpty method

AbstractRuleBuilder notEmpty({
  1. String? message,
})

Checks if the object a string and is not empty

Implementation

AbstractRuleBuilder notEmpty({String? message}) {
  return must(
      (dynamic dyn) => dyn is String && dyn.isNotEmpty,
      message != null
          ? message
          : useKeyAsElementName
              ? '$key must not be empty'
              : "String must not be empty",
      code: "empty");
}