【发布时间】:2021-09-14 13:40:05
【问题描述】:
我想在 Flutter 中突出显示文本,但我想按顺序突出显示文本中的每个单词。因此,第一个单词被突出显示(并且前一个恢复正常,即未突出显示),然后是第二个单词,然后是第三个单词..等等。 我怎么能在 Flutter 中做这样的事情。
#编辑 我想对其进行动画处理,以便高光按顺序移动。例如,第一个单词用黄色突出显示,然后恢复正常,然后第二个单词突出显示,然后恢复正常,依此类推...... 我希望你明白了。
【问题讨论】:
-
这段代码有帮助吗?
-
RichText( text: TextSpan( children: [ TextSpan(text: 'highlighted',style: TextStyle(color: Colors.black, backgroundColor: Colors.yellow)), TextSpan(text: ' the rest',style: TextStyle(color: Colors.black)), ] ), )
标签: android ios flutter dart mobile