flutter - 我该如何解决这个错误(A RenderFlex 在底部溢出了 104 个像素。)
问题描述
这(在 ListTile 内尾随)在 Flutter 中
trailing: Column(
children: <Widget>[
new IconButton(icon: Icon(Icons.arrow_drop_up), onPressed: (){}),
Text("Hello"),
new IconButton(icon: Icon(Icons.arrow_drop_down), onPressed: (){}),
],
),
解决方案
trailing: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Expanded(
child: new IconButton(
padding: EdgeInsets.zero,
icon: Icon(Icons.arrow_drop_up), onPressed: (){}),
),
Expanded(child: Text("Hello")),
Expanded(child: new IconButton(icon: Icon(Icons.arrow_drop_down), onPressed: (){})),
],
),