How to save ImageCache to the disk in flutter?

Posted by Jennifer | Updated on

Want to save ImageCache to the disk in flutter? Flutter’s image cache is for decoded images. It sounds like what you want is a cache of encoded image files.

You could build this yourself by downloading to files to device storage and using Image.file, but you’d probably want to implement some kind of eviction logic to make sure you don’t consume too much space on the device.

You could use Image.asset for static images that you want to bundle with your app.

Consider preloading your images before the user gets to the point where they are displayed. This will create the illusion that they load instantly.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers