我正在尝试在颤动中布局一个单元格,并且如果没有大量硬编码的填充,就无法将它们隔开。下图是布局的方式,以及我想要的方式。
在单元格中使用可扩展或灵活的布局,我不断得到没有单元格的空白屏幕。它们似乎在不可滚动的布局上运行良好。
当前的
想
@override
Widget build(BuildContext context) {
Constants constants = Constants.of(context);
return Container(
constraints: BoxConstraints.tightFor(height: constants.d200),
margin: EdgeInsets.all(10.0),
child: Card(
color: constants.white,
child: Column(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
color: constants.white,
child: Text(product.name,
style: TextStyle(
fontWeight: FontWeight.normal,
color: constants.orange)),
),
SizedBox(
height: constants.d10,
),
Container(
color: constants.white,
child: Text(product.ean,
style: TextStyle(
fontWeight: FontWeight.bold, color: constants.black)),
),
Container(
color: constants.white,
child: Icon(
Icons.ac_unit,
size: 10,
color: constants.orange,
),
),
],
),
],
),
),
);
}


