gpt4 book ai didi

image - 如何在Flutter中将图像下载到画廊

转载 作者:行者123 更新时间:2023-12-03 03:20:33 24 4
gpt4 key购买 nike

我正在使用学校管理应用程序,在这里我需要将图像和视频发送到该应用程序,并允许用户将图像和视频下载到他们的手机库中。我被困住了!
请帮帮我..谢谢

最佳答案

这是可能有用的功能

saveImage(String url) async {

var response = await Dio()
.get(url, options: Options(responseType: ResponseType.bytes));
final result = await ImageGallerySaver.saveImage(
Uint8List.fromList(response.data),
quality: 100,
name: "${widget.id}");
}

为了使用此功能,您必须安装两个软件包(并将它们安装在pubspec.ymal文件中):
dio: ^3.0.10
image_gallery_saver: '^1.5.0'

关于image - 如何在Flutter中将图像下载到画廊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63502183/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com