【发布时间】:2021-04-01 21:35:56
【问题描述】:
我需要创建一个类似于下图的 UI。要缩小的第二个文本为连续第三个文本留出空间。
例外的用户界面
但第二个文本不会缩小,而第三个文本小部件会缩小
当前用户界面
我使用扩展来包装第三个 Text 小部件。它没有帮助。
Row(children: [
Container(color:Colors.lightBlue, child:Text('1one'),),
Container(
color:Colors.lightGreen,
child:Text(
'2Two2Two2Two2dbTwo2Two2Two2Two2Two2Two2Two2Two2Two2Two2Two2Two2',
overflow: TextOverflow.ellipsis)),
Expanded(
child:Container(
color:Colors.orange,
child: Text('Three3Three3Three3Three3Three3Three3Three3Three3Three3Three')
)
)
])
【问题讨论】:
-
尝试在所有文本小部件上将
maxLines设置为 1