My flutter app uses the camera
package to take a photo, which I save to the application's data directory (obtained from path_provider
and the getApplicationDocumentsDirectory()
function).
How can I save this image file into the phone photo gallery? I've noticed the image_picker
package allows reading from the gallery, but how can I write to it?
https://pub.dev/packages/gallery_saver
this plugin saves images and video to gallery/photos.
You just need to provide it with path to temp file that you got from Camera(or even network url, it also works):
GallerySaver.saveVideo(recordedVideo.path);
GallerySaver.saveImage(recordedImage.path);