单击带有进度条的按钮时,我需要将视频从服务器下载到设备存储中我在下面的代码中使用了它,但它对我来说效果不佳
downloadUsingDio(String mediaURL, String fileName) async {
Dio dio = Dio();
await getApplicationDocumentsDirectory().then((appDir) async {
var filePath =
await File(appDir.path + '/' + fileName).create(recursive: true);
var myFile = await dio.download(mediaURL, filePath.path);
print(myFile);
});
}