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?
答案 0 :(得分:1)
Flutter的image cache用于解码图像。听起来你想要的是编码图像文件的缓存。
您可以通过下载到文件到设备存储并使用Image.file
来自行构建,但您可能希望实现某种逐出逻辑以确保不会在设备上占用太多空间
您可以将Image.asset
用于要与应用捆绑在一起的静态图片。
考虑在用户到达显示图像之前预先加载图像。这将产生他们立即加载的错觉。