truncate method
Truncates a string to the provided truncateLength
Implementation
String truncate(int truncateLength, {String endString = "..."}) =>
truncateLength >= this.length
? this
: this.slice(0,truncateLength - endString.length) +
endString;