4

I load lots of image from the internet with Image.network statement and I know the ImageCache only save them until then the app is running. But I want save cache, because I don't want always downloading images, when app starting. So: save cache to the disk is possible in flutter?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

"eviction" logic?
@ThinkDigital "Eviction" means deleting from the cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.