Blinking images upon returning back to an already loaded view
Hey all - I have been working on an app for a while now and I noticed that I keep encountering a flicker whenever I navigate to a new page and come back.
Page1 Page2
From Page1 I navigate to Page2. From Page2 I click a button to run Navigation.context.pop() and it returns to Page1 however all of the images need a blink of a millisecond to load up. This gives the app a very poor user experience.
If so what can I do about this?
https://github.com/Baseflow/flutter_cached_network_image/issues/325#issuecomment-689182016
Have the same problem, When I returning back from page B to pageA .
I use Flutter 3.7.3 , cached_network_image: ^3.2.1 Flutter 3.7.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 9944297138 (7 days ago) • 2023-02-08 15:46:04 -0800 Engine • revision 248290d6d5 Tools • Dart 2.19.2 • DevTools 2.20.1
Still an issue.
Looks like we won't see any answers here. If you change CachedNetworkImage to Image.network or FadeInImage.memoryNetwork the situation will not change. I've narrowed down the problem, any other ideas from a colleague?
Again I guys suggest to use imageUrl with smaller size. It helped me.
I don’t know about you, but in my case, in addition to CachedNetworkImage(), neighboring Row() widgets also twitched ...
But I do not understand what is responsible for this? Why is this happening? Guessing that the framework decides to clean itself up and rebuild itself, something to do with the garbage collector? Who to ask this
Same problem, Page A -> Page B(pop) ->Page C. Open the gallery In Page C by using image_picker . Page C ->Page A. NetWorkImages in Page A will shirking.
Image( image: CachedNetworkImageProvider(data.preview),gaplessPlayback: true) can fix the problem.
CachedNetworkImage(imageUrl: xxx, useOldImageOnUrlChange: true ) is not worked.
I also encountered the same problem, some pages will have this problem, some pages will not, some devices will happen, some devices will not; when the loading process occurs, the image is actually already in the cache, it may be that the part is destroyed , but the loading process is too slow, probably similar to loading image.assets for the first time
WORKAROUND could be:
Download image as a file from API to appdirectory and show it using Image.file().
But everytime you fetch image you have to compare either image coming from API is same as stored in local storage or not. If same then don't do anything and show previous image. Else firstly download new image from API and then save it locally and then show it using Image.file().
Its a long process.
Any solution or workaround for this or any other alternate packages