1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 06:53:23 +00:00

Disable pre-rendering

This commit is contained in:
Pierre HUBERT 2020-05-08 09:14:25 +02:00
parent c7f970ae70
commit edff7868f2

View File

@ -13,18 +13,15 @@ import 'package:url_launcher/url_launcher.dart';
/// @author Pierre HUBERT
class TextRichContentWidget extends StatelessWidget {
final TextSpan rootSpan;
final TextAlign textAlign;
final TextStyle style;
final String text;
TextRichContentWidget(
String text, {
this.text, {
this.textAlign,
this.style,
}) : assert(text != null),
/// Parse content now so we won't have to do it later
rootSpan = TextSpan(style: style, children: _parse(text, style));
}) : assert(text != null);
/// Parse the text and return it as a list of span elements
static List<TextSpan> _parse(String text, TextStyle style) {
@ -67,6 +64,7 @@ class TextRichContentWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RichText(textAlign: textAlign, text: rootSpan);
return RichText(
textAlign: textAlign, text: TextSpan(children: _parse(text, style)));
}
}