textMessageSpannableText function

Widget textMessageSpannableText(
  1. String message,
  2. TextStyle? textStyle,
  3. Color urlColor, {
  4. int? maxLines,
})

Implementation

Widget textMessageSpannableText(
  String message,
  TextStyle? textStyle,
  Color urlColor, {
  int? maxLines,
}) {
  //final GlobalKey textKey = GlobalKey();
  TextStyle? underlineStyle = textStyle?.copyWith(
      color: urlColor,
      decoration: TextDecoration.underline,
      decorationColor:
          urlColor); //const TextStyle(decoration: TextDecoration.underline, fontSize: 14, color: Colors.blueAccent);
  TextStyle? normalStyle =
      textStyle; //const TextStyle(fontSize: 14, color: textHintColor);
  var prevValue = "";
  return Text.rich(
    customTextSpan(message, prevValue, normalStyle, underlineStyle),
    maxLines: maxLines,
    overflow: maxLines == null ? null : TextOverflow.ellipsis,
  );
}