limitTextLength static method
Implementation
static String? limitTextLength(String? text, int length, {String endString = '...'}) {
if (text == null) {
return null;
}
if (text.length > length) {
return '${text.substring(0, length)}$endString';
} else {
return text;
}
}