ellipsize method

String ellipsize(
  1. int maxLength
)

Limit string length (adds "..." if too long)

Implementation

String ellipsize(int maxLength) {
  if (length <= maxLength) return this;
  return '${substring(0, maxLength)}...';
}