I have an app using a GridView
to try and lay out some Card
s. The relevant code looks a bit like this
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
],
),
Unfortunately, it doesn't render well:
The cards are too tall, they should end just below the "CALL TO ACTION" button. How can I fix this, and have the grid rows automatically respect the height of the contents?