Baseflow / Baseflow/flutter_cached_network_image
Reload an image from network after error?
- Dominant language
- Dart
- Stars
- 2.6k
- Forks
- 731
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
## 💬 Questions and Help
Please advice if I am doing something wrong.
I create a CachedNetworkImageProvider and use it in an Image. In case there is a network error (lost connectivity), I use a certain placeholder instead of an image. What I want do next, is to try to reload an image upon some user action, and, if the connection is up again, actually load an image. To do that I create a new CachedNetworkImageProvider for rebuilding an Image, but it doesn't work. Calling the resolve method just immediately throws the same error as before (host not found), even not bothering to try it again. What I discovered then is that CachedNetworkImageProvider's instance hash is derived from the link and the scale values, and that's it. It seems that if I create a new CNIP with the same arguments as before, it is actually not really a new one. But if I modify the link in any way, viola! It loads the image as expected.
Please help me to understand if I am misusing the library, or if it is an intended behaviour after all?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.