0
我有一个应用程序使用GridView
来尝试和布置一些Card
s。相关的代码看起来有点像这样包含卡的GridView不能正确计算高度
body: new GridView.count(
crossAxisCount: 2,
children: [new Card(
child: new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: const Text("0", style: const TextStyle(
fontWeight: FontWeight.bold, fontSize: 24.0)),
title: const Text('Some Heading'),
subtitle: const Text('My Subtitle'),
),
new ButtonTheme
.bar(// make buttons use the appropriate styles for cards
child: new ButtonBar(
children: <Widget>[
new FlatButton(
child: const Text('CALL TO ACTION'),
onPressed:() {
/* ... */
},
),
],
),
),
],
),
),
// same card repeated
],
),
不幸的是,它没有很好地渲染:
该卡是太高,他们应该结束仅低于“行动呼吁”按钮。我怎样才能解决这个问题,并让网格行自动尊重内容的高度?