Skip to content

Commit a38431c

Browse files
author
Julian KOUNE
committed
fix: prevent inlineSpanEnd from getting rich text styles
1 parent 7188436 commit a38431c

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

lib/text_parser.dart

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -998,33 +998,29 @@ class TextParser extends StatelessWidget {
998998
final childRichText = richText.child;
999999
if (childRichText is TextSpan) {
10001000
return CleanRichText(
1001-
TextSpan(
1002-
text: childRichText.text,
1003-
style: childRichText.style,
1004-
recognizer: childRichText.recognizer,
1005-
mouseCursor: childRichText.mouseCursor,
1006-
onEnter: childRichText.onEnter,
1007-
onExit: childRichText.onExit,
1008-
semanticsLabel: childRichText.semanticsLabel,
1009-
locale: childRichText.locale,
1010-
spellOut: childRichText.spellOut,
1011-
children: [
1012-
if (childRichText.children != null)
1013-
...childRichText.children!,
1014-
inlineSpan
1015-
]
1016-
),
1001+
TextSpan(children: [
1002+
TextSpan(
1003+
text: childRichText.text,
1004+
style: childRichText.style,
1005+
recognizer: childRichText.recognizer,
1006+
mouseCursor: childRichText.mouseCursor,
1007+
onEnter: childRichText.onEnter,
1008+
onExit: childRichText.onExit,
1009+
semanticsLabel: childRichText.semanticsLabel,
1010+
locale: childRichText.locale,
1011+
spellOut: childRichText.spellOut,
1012+
children: [
1013+
if (childRichText.children != null) ...childRichText.children!,
1014+
],
1015+
),
1016+
inlineSpan
1017+
]),
10171018
maxLines: richText.maxLines,
10181019
textAlign: richText.textAlign,
10191020
);
10201021
} else {
10211022
return CleanRichText(
1022-
TextSpan(
1023-
children: [
1024-
childRichText,
1025-
inlineSpan
1026-
]
1027-
),
1023+
TextSpan(children: [childRichText, inlineSpan]),
10281024
maxLines: richText.maxLines,
10291025
textAlign: richText.textAlign,
10301026
);

0 commit comments

Comments
 (0)