为什么当我在 StaggeredGridView 中使用堆栈小部件时图像尺寸会变得奇怪。当我从网格视图中删除堆栈时,布局看起来非常好。我是否以错误的方式使用布局?
new StaggeredGridView.countBuilder(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
itemCount:model.hit.length,
itemBuilder: (context, index) {
return
Stack(
children: [
Container(
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.all(Radius.circular(35))),
child:
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(35)),
child:FadeInImage.memoryNetwork(
placeholder: kTransparentImage, image: model.hit[index]['largeImageURL'],fit: BoxFit.cover,)
),
)
],
);
},
staggeredTileBuilder: (index) {
return new StaggeredTile.count(1, index.isEven ? 1.2 : 1.8);
})