ErrorWidget only working once
Thanks for the great package first of all.
When starting the app and coming across a broken url, the errorWidget is shown after a short loading phase (during which the placeholder is shown). That's working as expected. But once I encounter an image with the same url (e.g. pushing a detail page), the placeholder is shown forever, instead of switching to the errorWidget. No matter whether state is disposed, the errorWidget will never be shown again until a Hot Restart is being performed.
Since my placeholder widget (a shimmer loading animation), differs from the errorWidget, this creates the impression of a broken connection, which might confuse some users.
It think it's quite a big issue (at least for me), so I would appreciate any solution proposals.
I am experiencing the exact same bug. The errorWidget seems to work on first load, but if you scroll down and back up, it no longer displays and will only displace the placeholder. I do not remember this being an issue in the past.
Were you able to figure this out? The error widget still seems to not be working properly.
@renefloor could you please have a look at this issue? Or maybe provide some insight where one would have to adapt the code?
I played around with this and it looks like this only happens when maxWidthDiskCache and/or maxHeightDiskCache is set. Without these properties the errorWidget gets called every time as expected.
I tried to debug this a little bit and it seems like it has something to do with flutters internal Image Cache: Even though flutter_cached_network_image calls PaintingBinding.instance.imageCache.evict(key) when something goes wrong, which in turn removes the pending image from the internal _pendingImages` HashMap from flutters image cache, the next time the erroneous image gets loaded the ImageCache still seems to have the image cached somehow?