hasMaxLengthIfNotNullOrEmpty method

ContractValidations hasMaxLengthIfNotNullOrEmpty(
  1. String text,
  2. int max,
  3. String property,
  4. String message,
)

Implementation

ContractValidations hasMaxLengthIfNotNullOrEmpty(
    String text, int max, String property, String message) {
  if (text.isNotEmpty && text.length > max)
    addNotifications(
        ValidationNotification(property: property, message: message));

  return this;
}