在flutter中编写长文本时如何制作段落?

问题描述

如何在文本小部件中使段落颤动? 这只是一个长文本,看起来很愚蠢

我想要的: 你好,

你好吗?

它是什么:

你好,你好吗?

解决方法

使用 \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,)
          ),],),)