textWidget method
Utility method to create a styled Text widget using the textAlign and
textStyle, but you can specify the data.
Implementation
Widget textWidget(String data) => Builder(
builder: (context) {
// if (data.contains(" · · · ")) {
// return SimpleRichText(
// data,
// logIt: false,
// style: textStyle,
// textAlign: textAlign,
// textOverflow: TextOverflow.ellipsis,
// maxLines: 1,
// );
// } else {
if (data.isNotEmpty) {
return SimpleRichText(
"\n› " + data + "\n",
logIt: false,
style: textStyle,
textAlign: textAlign,
textOverflow: TextOverflow.ellipsis,
maxLines: 5,
);
} else {
return SimpleRichText(
"\n› ···" + "\n",
logIt: false,
style: textStyle,
textAlign: textAlign,
textOverflow: TextOverflow.ellipsis,
maxLines: 5,
// pre: TextSpan(text: 'PRE', style: TextStyle(color: Colors.purple)),
// post: TextSpan(text: 'POST', style: TextStyle(color: Colors.purple)),
);
}
},
);