gpt4 book ai didi

dart - 行小部件中的文本换行

转载 作者:行者123 更新时间:2023-12-03 02:43:53 31 4
gpt4 key购买 nike

我使用以下代码嵌套了行:

    Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
children: <Widget>[
Icon(Icons.fiber_manual_record),
Text(
'the text in the first row',
),
],
),
Row(
children: <Widget>[
Icon(Icons.fiber_manual_record),
Text(
'the text in the second row',
),
],
),
],
)

当有空间时,我希望行并排(当前行为):

enter image description here

目前,当它溢出时,文本会像这样被截断:

nested rows

当没有空间时,有没有办法强制第二行到新行,所以它看起来像这样?

new lines

最佳答案

尝试这个!它对我有用。

new Flexible(child: new Text('Auto wrap'))

关于dart - 行小部件中的文本换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53423504/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com