Skip to content

Commit 0c4086f

Browse files
replace rich text indirection to support maxLines properly (#85)
otherwise maxLines would do nothing, since the Text.rich constructor would be unrestricted. There is no visual change besides, that maxLines now properly truncates the text.
1 parent 23fde5b commit 0c4086f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/flutter_linkify.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ TextSpan buildTextSpan(
325325
LinkCallback? onOpen,
326326
}) {
327327
return TextSpan(
328-
children: elements.map<WidgetSpan>(
328+
children: elements.map<InlineSpan>(
329329
(element) {
330330
if (element is LinkableElement) {
331331
return LinkableSpan(
@@ -339,11 +339,9 @@ TextSpan buildTextSpan(
339339
),
340340
);
341341
} else {
342-
return WidgetSpan(
343-
child: Text.rich(TextSpan(
344-
text: element.text,
345-
style: style,
346-
)),
342+
return TextSpan(
343+
text: element.text,
344+
style: style,
347345
);
348346
}
349347
},

0 commit comments

Comments
 (0)