如何将照片的高度添加到列表平铺的全高和宽度(例如200)中?
Card(
child: ListTile(
leading: ConstrainedBox(
constraints: BoxConstraints(
minWidth: 80,
minHeight: 80,
),
child: Image.network('https://d-pt.ppstatic.pl/k/r/1/59/d4/5cb1dbc30ec6d_p.jpg?1555262447', width: 120, height: 120),),
title: Text('Three-line ListTile'),
subtitle: Text(
'A sufficiently long subtitle warrants three lines.'
),
trailing: Icon(Icons.more_vert),
isThreeLine: true,
),
),
答案 0 :(得分:0)
您可以执行以下操作:
Card(
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: Image.network(
'https://d-pt.ppstatic.pl/k/r/1/59/d4/5cb1dbc30ec6d_p.jpg?1555262447',
),
),
Expanded(
flex: 2,
child: ListTile(
title: Text('Three-line ListTile'),
subtitle:
Text('A sufficiently long subtitle warrants three lines.'),
trailing: Icon(Icons.more_vert),
isThreeLine: true,
),
),
],
),
),
然后根据flex属性调整图像的大小。