mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Disable pre-rendering
This commit is contained in:
		@@ -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)));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user