-
-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalidate cached image? #117
Comments
+1 |
There is now. |
|
@Xgamefactory if you import flutter_cache_manager you can call |
@renefloor Thanks for this hint! Removing the entry from the cache with Prior to 3f59818 this might could have been fixed by additionally checking whether the CacheManager still got the file in memory. @override
void didUpdateWidget(CachedNetworkImage oldWidget) {
if (oldWidget.imageUrl != widget.imageUrl || _cacheManager.getFileFromMemory(imageUrl) == null) {
_streamBuilderKey = UniqueKey();
if (!widget.useOldImageOnUrlChange) {
_disposeImageHolders();
_imageHolders.clear();
}
_createFileStream();
}
super.didUpdateWidget(oldWidget);
} I don't know how to do this with the new |
@jagmit 'evict' should work: https://api.flutter.dev/flutter/painting/ImageProvider/evict.html |
@renefloor Thank you for your quick reply. Evicting the image from the ImageProvider still doesn't cause the image to refetch when rebuilding the widget after the cache eviction. |
Have to test that, but I at least see an issue there on this line: https://github.com/Baseflow/octo_image/blob/8c33667cb5a7593651a1085edd299eb38d73be32/lib/src/image.dart#L313 |
Were you able to reproduce it or should I try to provide an example project with this issue? |
Didn't have time for it yet, but an example is always nice to speed things up. |
Is there a way to force-invalidate a given cached image?
The text was updated successfully, but these errors were encountered: