我有一个ReorderableListView
,其中包含元素列表(下面的代码),但是当您长按该元素以进行重新排序时,它会展开Container
来填充整个屏幕。下图:
这是长按时的样子:
我希望代码仍然允许Container
扩展,因为当TextFormFields
出现错误时需要扩展。这是我的Container
:
Container(
padding: EdgeInsets.all(8),
child: Column(
children: <Widget>[
TextFormField(),
Align(
alignment: Alignment.topLeft,
child: Text(
'Drill Name',
style: TextStyle(fontSize: 12, color: Color(0x70000000)),
),
),
const SizedBox(
height: 15,
),
TextFormField(),
Align(
alignment: Alignment.topLeft,
child: Text(
'Shots',
style: TextStyle(fontSize: 12, color: Color(0x70000000)),
),
)
],
),
)
我想以某种方式阻止我的Container
在重新排序时扩展,但是如果我的TextFormField
出现错误消息(例如,“演习名称不能为空”),则允许它扩展。
感谢您的帮助
答案 0 :(得分:0)
不确定是否找到答案,解决方案是将以下行添加到Column():
mainAxisSize: MainAxisSize.min