txtLength function
设置文字长度
Implementation
String txtLength(String? txt, {int? length, nullTxt = ""}) {
if (txt == null || txt == "") {
return nullTxt;
} else {
if (length != null && txt.length > length) {
return "${txt.substring(0, length)}...";
}
return txt;
}
}