getConstrained method

String getConstrained(
  1. int maxLength
)

Implementation

String getConstrained(int maxLength) {
  if (length > maxLength) {
    return "${substring(0, maxLength)}...";
  }
  return this;
}