问题是我有一个富文本(RichText)在可滚动的小部件中(SingleChildScrollView或ListView),我需要滚动到RichText内的特定TextSpan。但是,我无法使用ScrollablePositionedList,因为文本应该写在上一个文本的末尾,如果没有足够的空间来继续文本,它应该换到下一行,所以我必须使用RichText。
类似于示例代码:
ListView(
children:[
RichText(
children: AListOfTextSpansThatICreateWithIndexes(),
),
],
),
我想展示的样本文本:
This is TextSpan1 and it is a bit
long. This is TextSpan2 and its ok.