Reputation: 1027
I am making requests to my API to fetch images, it returns the bytes for the image. So what I do is I assign response.bodyBytes
to a Uint8List
.
Then I can display the image in a Image.memory()
widget.
How do I store large amounts of images in the phone memory, and check if it exists in memory before making more requests to my API?
Upvotes: 0
Views: 803
Reputation: 1027
I figured it out. I was using a Flask for my API and I used send_file()
to send it as a rendered image instead, now I can use the standard cached_network_image as a URL. I just had to change it from POST to GET, and use params instead of headers so I could use the imageURL
property.
Upvotes: 1