stringShorten function
Implementation
String stringShorten(String value, {int prefixLength = 6}) {
if (value.length <= 2 + 2 * prefixLength) {
return value.toString();
}
final tLength = value.length;
final secStart = value.length - prefixLength;
final firstPart = value.substring(0, prefixLength);
final secondPart = value.substring(secStart, tLength);
return '$firstPart…$secondPart';
}