首页 > 解决方案 > 如何从颤动的缓存图像网络中获取路径?

问题描述

我是flutter的新手,我想知道如何从flutter中的缓存图像网络获取路径,或者如何将网络图像保存到资产图像并获取该图像的路径?

标签: dartflutter

解决方案


更新的方法是使用DefaultCacheManagerFlutter Cache Manager包。

final cache = DefaultCacheManager(); // Gives a Singleton instance
final file = await cache.getSingleFile(yourURL);
// Now use file.path

推荐阅读