Flutter CachedNetworkImage doesn't work, loading images again when scrolling up to bottom or bottom to up

2,567 views
Skip to first unread message

Gursewak Singh

unread,
Sep 24, 2019, 2:25:13 AM9/24/19
to Flutter Development (flutter-dev)

I'm trying to work with cached images. I followed CachedNetworkImage but it doesn't work. Please help me if any other solution available in flutter

Here is video of my issue

When I scrolled list from up to bottom or bottom to up the images are gone and reloaded again

Stack Overflow Link


Andy Greenshaw

unread,
Sep 24, 2019, 3:59:33 AM9/24/19
to Flutter Development (flutter-dev), Gursewak Singh
CachedNetworkImage works fine for me.

Run your app on a simulator / emulator then you can see if the images have been cached.
Note that the image size makes a big difference (you don’t want them more than 100K and hopefully < 50K) as even if they are cached each time they have to be resown in the UI they have to be decoded. Looking at your video it looks like it takes a long time for the to load initially (which is either a slow internet or large files), then once they are loaded, then you still get the decode time (but that is a lot shorter than the initial download time).

In summary, make sure the images are of a sensible size for use in a mobile app.
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/5b2d1bc6-a0b0-46a5-9481-a283806e34ae%40googlegroups.com.

Andy Greenshaw

unread,
Sep 24, 2019, 7:11:57 AM9/24/19
to Flutter Development (flutter-dev), Gursewak Singh
Also, don’t forget if the source image width / height is different to the width / height you will display, the image has to be decoded and then resized. This takes time...
Reply all
Reply to author
Forward
0 new messages