@@ -144,6 +144,10 @@ class HtmlRichTextParser extends StatelessWidget {
144
144
this .onLinkTap,
145
145
this .renderNewlines = false ,
146
146
this .html,
147
+ this .linkStyle = const TextStyle (
148
+ decoration: TextDecoration .underline,
149
+ color: Colors .blueAccent,
150
+ decorationColor: Colors .blueAccent),
147
151
});
148
152
149
153
final double indentSize = 10.0 ;
@@ -152,6 +156,7 @@ class HtmlRichTextParser extends StatelessWidget {
152
156
final onLinkTap;
153
157
final bool renderNewlines;
154
158
final String html;
159
+ final TextStyle linkStyle;
155
160
156
161
// style elements set a default style
157
162
// for all child nodes
@@ -497,13 +502,9 @@ class HtmlRichTextParser extends StatelessWidget {
497
502
nextContext.parentElement = linkContainer;
498
503
nextContext.rootWidgetList.add (linkContainer);
499
504
} else {
500
- TextStyle linkStyle = parseContext.childStyle.merge (TextStyle (
501
- decoration: TextDecoration .underline,
502
- color: Colors .blueAccent,
503
- decorationColor: Colors .blueAccent,
504
- ));
505
+ TextStyle _linkStyle = parseContext.childStyle.merge (linkStyle);
505
506
LinkTextSpan span = LinkTextSpan (
506
- style: linkStyle ,
507
+ style: _linkStyle ,
507
508
url: url,
508
509
onLinkTap: onLinkTap,
509
510
children: < TextSpan > [],
@@ -812,6 +813,10 @@ class HtmlOldParser extends StatelessWidget {
812
813
this .customRender,
813
814
this .blockSpacing,
814
815
this .html,
816
+ this .linkStyle = const TextStyle (
817
+ decoration: TextDecoration .underline,
818
+ color: Colors .blueAccent,
819
+ decorationColor: Colors .blueAccent),
815
820
});
816
821
817
822
final double width;
@@ -820,6 +825,7 @@ class HtmlOldParser extends StatelessWidget {
820
825
final CustomRender customRender;
821
826
final double blockSpacing;
822
827
final String html;
828
+ final TextStyle linkStyle;
823
829
824
830
static const _supportedElements = [
825
831
"a" ,
@@ -940,10 +946,7 @@ class HtmlOldParser extends StatelessWidget {
940
946
child: Wrap (
941
947
children: _parseNodeList (node.nodes),
942
948
),
943
- style: const TextStyle (
944
- decoration: TextDecoration .underline,
945
- color: Colors .blueAccent,
946
- decorationColor: Colors .blueAccent),
949
+ style: linkStyle,
947
950
),
948
951
onTap: () {
949
952
if (node.attributes.containsKey ('href' ) && onLinkTap != null ) {
0 commit comments