mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-26 06:49:22 +00:00
Disable pre-rendering
This commit is contained in:
parent
c7f970ae70
commit
edff7868f2
@ -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)));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user