Image.network中的像素抖动导致底部溢出

时间:2019-03-23 19:38:48

标签: gridview flutter

我正在做一些带有抖动的项目,并且图像网络有问题,当我添加图像时,出现“像素抖动导致底部溢出”错误。你能帮我解决他的问题吗?我是新来的扑扑。

我的代码:

class Items extends StatelessWidget {
  List list;

  Items({this.list});

  @override
  Widget build(BuildContext context) {
    return GridView.builder(
        padding: EdgeInsets.all(10.0),
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
          childAspectRatio: (1 / 1),
          crossAxisCount: 2,
        ),
        itemCount: list == null ? 0 : list.length,
        itemBuilder: (context, i) {
          return Container(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                new Text(list[i]['name']),
                Image.network(
                    "http://mobileapi.vps50663.mylogin.co/public/uploads/products/thumbnail/" +list[i]['thumbnail'],
                    fit: BoxFit.fill,
                    height: 100.0,
                    //width: 80.0,
                    alignment: Alignment.center,
                    filterQuality: FilterQuality.low,

                ),
                new Text(list[i]['slug']),
              ],
            ),
          );
        });
  }
}

This is a screenshot of that error

1 个答案:

答案 0 :(得分:0)

这意味着图像的父容器小部件的大小比图像大小小14.0像素。尝试使您的容器的高度为120.0(以留出一些额外的空间)。那应该解决它