我有这张下图
我正在尝试在带有堆栈的图像末尾显示图标,但这是我得到的
我尝试过的代码
Stack(
children: [
Expanded(
flex: 0,
child: Image.network(
Urls.ImageUrl+vendorModel.cover_photo,
height: 80,
fit: BoxFit.fitWidth,
),
//radius: 52.5,
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Icon(Icons.favorite,color: Colors.red,),
],
),
],
),
答案 0 :(得分:2)
您不需要使用Expanded
小部件
尝试一下:
Row(
children: [
IntrinsicHeight(
child: Stack(
alignment: Alignment.bottomRight,
children: [
Image.network(
Urls.ImageUrl+vendorModel.cover_photo,
height: 80,
fit: BoxFit.fitWidth,
),
Icon(
Icons.favorite,
color: Colors.red
),
],
),
),
SizedBox(width: 8,),
Column(children: [
Text('text1'),
Text('text2'),
Text('text3'),
Text('text4')
],mainAxisSize: MainAxisSize.min,)
],
)