Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save an image to the photo gallery using Flutter?

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?

like image 454
Duncan Jones Avatar asked Apr 23 '18 18:04

Duncan Jones


People also ask

How do I save a picture to my gallery?

Control-click the illustration that you want to save as a separate image file, and then click Save as Picture.

How do you save a video to gallery flutter?

Gallery Saver for FlutterSaves images and videos from network or temporary file to external storage. Both images and videos will be visible in Android Gallery and iOS Photos. NOTE: If you want to save network image or video link, it has to contain 'http/https' prefix.


1 Answers

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);
like image 85
jelenap Avatar answered Oct 01 '22 15:10

jelenap