hui-z / image_gallery_saver

flutter中用于保存图片到相册的Plugin
MIT License
275 stars 377 forks source link

Saving the image has no result,no exception occurred #226

Open yang-junhua opened 1 year ago

yang-junhua commented 1 year ago

I saved many pictures to the album, and the pictures were saved successfully. However, there were no results returned during the saving process, and no exceptions occurred. I could not obtain the saving progress to prompt the user

perepechin commented 1 year ago

I have the same issue on iOS. It works just fine on Android :/

jeff-matawan commented 6 months ago

Are you saving the files in parallel ? I did this for it to work:

if (io.Platform.isAndroid) {
  await Future.wait(xFiles.map((file) => ImageGallerySaver.saveFile(file.path)));
} else {
  ///iOS doesn't support saving multiple files at once
  for (var i = 0; i < xFiles.length; i++) {
    await ImageGallerySaver.saveFile(xFiles[i].path);
  }
}