dart - 行小部件中的文本换行
问题描述
我使用以下代码嵌套了行:
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',
),
],
),
],
)
当有空间时,我希望行并排(当前行为):
目前,当它溢出时,文本会像这样被切断:
当没有空间时,有没有办法将第二行强制换行,所以它看起来像这样?
解决方案
尝试这个!它对我有用。
new Flexible(child: new Text('Auto wrap'))
推荐阅读
- python - 卡在“如果”,它不会继续过去
- sql-server - 从动态 SQL 中获取数据库名称的名称
- octobercms - 注册后如何创建临时欢迎页面?
- firebase - 当我在文档中有 500 多个字段时,Firestore Web 控制台会滞后。有替代方案吗?
- logging - 颤振:记录器
- dialogflow-es - 如何从您的 google 对话流代理调用对话流代理?
- java - 如何修复错误膨胀类 android.support.design.widget.BottomNavigationView
- javascript - 对 window.RemoveEventListener 是否会删除函数感到困惑
- node.js - 如何使用 node.js 和 express 上传、显示和擦除图像
- javascript - 移动模拟器期间的 javascript 事件 MOUSEOVER 和 CLICK