小编Mic*_*psa的帖子

捕获的图像小部件:失败的断言颤振

有时当我启动应用程序时,我会遇到这个问题

'package:cached_network_image/src/cached_image_widget.dart':断言失败:第 157 行 pos 16:'imageUrl != null':不正确。

在 cached_image_widget.dart 第 157 行:

 : assert(imageUrl != null),
Run Code Online (Sandbox Code Playgroud)

在我调用缓存图像小部件时的文件中:

child: CachedNetworkImage(
                      imageUrl: itemArticle.urlToImage,
                      imageBuilder: (context, imageProvider) {
                        return Container(
                          width: 72.0,
                          height: 72.0,
                          decoration: BoxDecoration(
                            image: DecorationImage(
                              image: imageProvider,
                              fit: BoxFit.cover,
                            ),
                          ),
                        );
                      },
Run Code Online (Sandbox Code Playgroud)

我的应用程序显示卡片视图(列表)。

你怎么看待这件事?有的怎么解决呢?

谢谢

android dart flutter

3
推荐指数
1
解决办法
1471
查看次数

标签 统计

android ×1

dart ×1

flutter ×1