How can i hide the CachedNetworkImage if there is an image issue.
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
该 issue 提供了一个 CachedNetworkImage 的内联示例;请先检查其 errorWidget 回调以及周围的列表项布局。完成的标准是确定列表项在 404 之后的行为,同时不留下固定高度的空框。
由索引模型根据 Issue 内容生成。
描述
Hi, Your package is working great.
I just have a one question.
I'm showing the big images in the list view. I need help and suggestions.
Basically there are some urls in the listview which have no images like they throw 404 error. And I'm handling these errors and showing the default images at the place of 404 images.
But now I want to hide the whole CachedNetworkImage on error instead of showing a place holder image.
Here is my code
CachedNetworkImage(
width: double.maxFinite,
fit: BoxFit.fill,
height: 200,
imageUrl: widget.model?.getPictureUrl ?? "",
progressIndicatorBuilder: (context, url, downloadProgress) => Container(
color: Colors.white,
child: Center(
child: Padding(
padding: const EdgeInsets.all(4.0),
child: CircularProgressIndicator(value: downloadProgress.progress),
))),
errorWidget: (context, url, error) => SizedBox.shrink())
Currently is showing an empty box but the box height is 200 so its looks bad.
So my main concern is i need to hide full CachedNetworkImage in the listview with best approach.
Can anyone please guide and help me.
Thanks
- 主要语言
- Dart
- 星标
- 2.6k
- 派生
- 731
- 平均合并
- 4 天 12 小时
- 30 天内合并 PR
- 2
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Baseflow/flutter_cached_network_image 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
Baseflow/flutter_cached_network_image#492 · 2 个 reaction ·
维护者通常 4 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
Baseflow/flutter_cached_network_image#478 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Baseflow/flutter_cached_network_image#473 ·
维护者通常 4 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
Baseflow/flutter_cached_network_image#1032 ·
维护者通常 4 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
Baseflow/flutter_cached_network_image#1031 ·
维护者通常 4 天内回复
查看 Baseflow/flutter_cached_network_image 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
MaikuB/flutter_local_notifications#2838 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
jiangtian616/JHenTai#833 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100