getTextNormal method
dynamic
getTextNormal(
- dynamic labelColor,
- dynamic param,
- dynamic value
Implementation
getTextNormal(labelColor, param, value) {
var showValue = '$value';
myLogAll('getTextNormal');
if ((param[gSearch] ?? '') != '' &&
showValue.toString().contains(param[gSearch])) {
List sA = showValue.split(param[gSearch]);
List<TextSpan> txtSpanChildren = [];
for (int i = 1; i < sA.length; i++) {
txtSpanChildren.add(TextSpan(
text: param[gSearch],
style: TextStyle(
color: labelColor,
decoration: param[gTextDecoration],
fontSize: getFontSize(param) ?? defaultFontSize,
backgroundColor: searchColor)));
txtSpanChildren.add(TextSpan(
text: sA[i],
style: TextStyle(
color: labelColor,
decoration: param[gTextDecoration],
fontSize: getFontSize(param) ?? defaultFontSize,
)));
}
return Text.rich(TextSpan(
text: sA[0],
style: TextStyle(
color: labelColor,
decoration: param[gTextDecoration],
fontSize: getFontSize(param) ?? defaultFontSize,
),
children: txtSpanChildren));
}
//print('---- getTextNormal showValue is $showValue');
return Text(
showValue,
textAlign: param[gAlign] ?? TextAlign.center,
maxLines: 10,
softWrap: true,
overflow: TextOverflow.ellipsis,
style: TextStyle(
/*fontWeight: (isNull(param[gIsBold]))
? param[gFontWeight]
: FontWeight.bold, //FontWeight.bold,*/
fontWeight: ((param[gIsBold]) ?? param[gFontWeight] ?? false)
? FontWeight.bold
: FontWeight.normal, //FontWeight.bold,
fontSize: getFontSize(param) ?? defaultFontSize,
color: param[gColorLabel] ?? labelColor,
decoration: param[gTextDecoration],
backgroundColor: Colors.transparent),
);
}