简体   繁体   English

Flutter:将下载的图像传递到第二个屏幕

[英]Flutter: pass downloaded image to second screen

I have a list if images download from internet. 我有一个列表,如果图像是从互联网下载的。 when you click on an image, it takes you to the image details screen. 单击图像时,它将带您进入图像详细信息屏幕。 I want to pass the downloaded image itself to the second screen and avoid loading it again from internet. 我想将下载的图像本身传递到第二个屏幕,并避免再次从Internet加载它。 How to achieve this? 如何实现呢?

I used cached image provider plug in and it did the trick https://pub.dartlang.org/packages/cached_network_image 我使用了缓存的图像提供程序插件,它起到了窍门https://pub.dartlang.org/packages/cached_network_image

When another image widget uses the same URL it will load from the cache instead of downloading it again. 当另一个图像小部件使用相同的URL时,它将从缓存加载,而不是再次下载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM