【发布时间】:2021-06-05 02:11:03
【问题描述】:
在应用程序的移动版本上,我使用的是esys flutter share package
这是我正在使用的 sn-p:
() async {
var request = await HttpClient()
.getUrl(Uri.parse(product.imageUrl));
var response = await request.close();
Uint8List bytes =
await consolidateHttpClientResponseBytes(response);
await Share.file(
'Text to show?', 'amlog.jpg', bytes, 'image/jpg',
text: '${product.name}\nSolo por $finalPrice');
}
很遗憾,这个包不支持 Web 平台。
有一个包叫share plus 2.0
在示例中,他们说可以通过以下方式共享文件:
Share.shareFiles(['${directory.path}/image.jpg'], text: 'Great picture');
Share.shareFiles(['${directory.path}/image1.jpg', '${directory.path}/image2.jpg']);
但是,就我而言,该文件位于 S3 上。我需要将它下载到某个应用程序文件夹中。因为我的应用程序是 Web 我不知道如何下载图片并存储在应用程序的文件夹中。这可能吗?还有其他方法可以实现我想要的吗?
【问题讨论】:
标签: flutter dart flutter-web