CHRISTOPANANJICKAL / fast_cached_network_image

A flutter package to cache network image fastly without native dependencies.
MIT License
30 stars 36 forks source link

The loadingBuilder method overrides the cached image #47

Open migdev-br opened 8 months ago

migdev-br commented 8 months ago

Hi team, before caching the loadingBuilder shows a circular progress indicator with fadeIn effect, which is fine, however, if I navigate to another page and get back, the loadingBuilder checks if the image is cached as expected but it shows nothing before loading the image that was already cached resulting in a terrible UX.

I appreciate it if you guys have a look at this.

Thanks a lot!

CHRISTOPANANJICKAL commented 8 months ago

Can you post a sample video showing the issue

migdev-br commented 8 months ago

Hi, please check below. https://github.com/migdev-br/cachtest-app Thanks,

CHRISTOPANANJICKAL commented 8 months ago

https://github.com/CHRISTOPANANJICKAL/fast_cached_network_image/assets/58786637/dcf9328e-38e8-4e69-b40c-61a1362fe0d0

@migdev-br I could see the loading builder after navigating again to the image page. Can you please clarify the issue which you have mentioned?

migdev-br commented 7 months ago

The loading indicator and fade-in effect should be visible only when the image is loading/fetching, once cached the image should appear directly. That should be the expected behavior from my point of view and also as per cached_network_image package.

CHRISTOPANANJICKAL commented 7 months ago

I see. But here when the fastCachedImage is called, we need to check and get the image from the cache which will be an asynchronous function. This function may take some time if the cache db big. So there is no way to avoid a loading indicator until the image is retrieved from the DB.