buildTextSpanChildren function
List<InlineSpan> ?
buildTextSpanChildren(
- List<
LinkElement> elements, { - TextStyle? style,
- TextStyle? linkStyle,
- LinkCallback? onOpen,
- bool useMouseRegion = false,
Raw TextSpan builder for more control on the RichText
Implementation
List<InlineSpan>? buildTextSpanChildren(
List<LinkElement> elements, {
TextStyle? style,
TextStyle? linkStyle,
LinkCallback? onOpen,
bool useMouseRegion = false,
}) =>
[
for (var element in elements)
if (element is LinkableElement)
TextSpan(
text: element.text,
style: linkStyle,
recognizer: onOpen != null
? (TapGestureRecognizer()..onTap = () => onOpen(element))
: null,
mouseCursor: useMouseRegion ? SystemMouseCursors.click : null,
)
else
TextSpan(
text: element.text,
style: style,
),
];