From db52c495ec88b8a0b8b3f3e6ae2762fe2ea8d30e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 9 May 2020 12:47:00 +0200 Subject: [PATCH] Fix theming issue --- lib/ui/widgets/text_widget.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ui/widgets/text_widget.dart b/lib/ui/widgets/text_widget.dart index 8e5b892..249bd62 100644 --- a/lib/ui/widgets/text_widget.dart +++ b/lib/ui/widgets/text_widget.dart @@ -33,27 +33,27 @@ class TextWidget extends StatelessWidget { Widget build(BuildContext context) { if (this.content.isNull || this.content.isEmpty) return Text(""); + var usedStyle = style == null ? Theme.of(context).textTheme.body1 : style; + var content = this.content.parsedString; /*// Parse BBcode if (parseBBcode) return BBCodeParsedWidget( text: content, - parseCallback: (style, text) => _parseLinks(context, text, style), + parseCallback: (style, text) => _parseLinks(context, text, usedStyle), );*/ // Just parse link return RichText( textAlign: textAlign, - text: TextSpan(children: _parseLinks(context, content, style)), + text: TextSpan(children: _parseLinks(context, content, usedStyle)), ); } /// Sub parse function List _parseLinks( BuildContext context, String text, TextStyle style) { - if (style == null) style = TextStyle(); - var buff = StringBuffer(); final list = new List();