我已经试过发布的解决方案 此处 但似乎都不奏效。
Container(
child: Center(
child: Text(
"Financial Formulas\n",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
color: Colors.blue,
width: 150,
height: 35,
),
要将文本换成新的行,使用 /n
.
你的情况下,把你的代码改成下面的代码。
Container(
child: Center(
child: Text(
// Financial will be on a line and Formulas on another line
"Financial\nFormulas",
// the text align property tells you how to arrange the texts
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
color: Colors.blue,
width: 150,
height: 35,
),
希望能帮到你