【发布时间】:2021-07-06 07:51:42
【问题描述】:
如何在文本小部件中使段落颤动? 都是一篇长文,看起来很蠢
我想要的: 你好,
你好吗?
它是什么:
你好,你好吗?
【问题讨论】:
如何在文本小部件中使段落颤动? 都是一篇长文,看起来很蠢
我想要的: 你好,
你好吗?
它是什么:
你好,你好吗?
【问题讨论】:
对段落使用\n,例如:Text('Hello,\n\nhow are you?')
【讨论】:
另一种方法,使用 RichText:
RichText(
text: TextSpan(
text: 'Hello,',
style: TextStyle(color: Colors.black, fontSize: 18.0),
children: <TextSpan>[
TextSpan(
text: 'how are you?',
style: TextStyle(fontWeight: FontWeight.bold, )
),
],
),
)
【讨论】: