You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a FutureBuilderthat will get a network image and display it. But I also need image dimensions for a separate process. So I have created two separate futures which will work in the FutureBuilder:
I believe both of these futures are called simultaneously on the same image. I do not want to make two separate network requests for the same image, I was hoping one will go first and save the image in the cache and then the second one will just use the image retrieved from the cache.
Is ExtendedNetworkImage smart enough to deal with two simultaneous requests? Or is there a chance that there will be two separate downloads of the same image?
The text was updated successfully, but these errors were encountered:
In my case, using LoadState.completed gives the proper image dimension, but because I have to modify the scrollcontroller position with the result I get one of those setState() or markNeedsBuild called during build errors. I don't want to put it in a postcallframe callback because then there is a one frame lag and creates a bad UI experience.
Doing it as two futures that wait for each other works perfectly, except that Im afraid it might be doing two network calls?
If there aren't two network calls with such an approach, then problems are solved
I have created a
FutureBuilder
that will get a network image and display it. But I also need image dimensions for a separate process. So I have created two separate futures which will work in the FutureBuilder:FutureBuilder
Future 1: Retrieve the image
Future 2: Get the image dimensions
I believe both of these futures are called simultaneously on the same image. I do not want to make two separate network requests for the same image, I was hoping one will go first and save the image in the cache and then the second one will just use the image retrieved from the cache.
Is ExtendedNetworkImage smart enough to deal with two simultaneous requests? Or is there a chance that there will be two separate downloads of the same image?
The text was updated successfully, but these errors were encountered: