appendText method

RichTextUtil appendText(
  1. String text, {
  2. Color color = const Color(0xff222222),
  3. double size = 14,
  4. bool bold = false,
  5. double? height,
  6. TextDecoration? decoration,
  7. VoidCallback? onTap,
})

Implementation

RichTextUtil appendText(String text, {Color color = const Color(0xff222222),
      double size = 14, bool bold = false, double? height, TextDecoration? decoration,
VoidCallback? onTap}) {
  var span = TextSpan(text: text, style: TextStyle(color: color, decoration: decoration,
          fontSize: size, height: height, fontWeight: bold ? FontWeight.w600 : FontWeight.normal),
      recognizer: TapGestureRecognizer()..onTap = onTap);
  spans.add(span);
  return this;
}