File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ class TextLine extends StatelessWidget {
119
119
final textNode = node as leaf.Text ;
120
120
final style = textNode.style;
121
121
var res = const TextStyle ();
122
+ final color = textNode.style.attributes[Attribute .color.key];
122
123
123
124
< String , TextStyle ? > {
124
125
Attribute .bold.key: defaultStyles.bold,
@@ -128,7 +129,16 @@ class TextLine extends StatelessWidget {
128
129
Attribute .strikeThrough.key: defaultStyles.strikeThrough,
129
130
}.forEach ((k, s) {
130
131
if (style.values.any ((v) => v.key == k)) {
131
- res = _merge (res, s! );
132
+ if (k == Attribute .underline.key || k == Attribute .strikeThrough.key) {
133
+ var textColor = defaultStyles.color;
134
+ if (color? .value is String ) {
135
+ textColor = stringToColor (color? .value);
136
+ }
137
+ res = _merge (res.copyWith (decorationColor: textColor),
138
+ s! .copyWith (decorationColor: textColor));
139
+ } else {
140
+ res = _merge (res, s! );
141
+ }
132
142
}
133
143
});
134
144
@@ -159,7 +169,6 @@ class TextLine extends StatelessWidget {
159
169
}
160
170
}
161
171
162
- final color = textNode.style.attributes[Attribute .color.key];
163
172
if (color != null && color.value != null ) {
164
173
var textColor = defaultStyles.color;
165
174
if (color.value is String ) {
You can’t perform that action at this time.
0 commit comments