media_gallery_saver

This plug-in allows you to save files to the iOS and Android galleries from url, asset, and file. If authorization is required when saving, an authorization dialog will appear.

Supported Files

  • jpg
  • png
  • gif
  • webp
  • heic
  • mp4
  • mov

Usage

# pubspec.yaml
dependencies:
  media_gallery_saver: ^1.1.0

iOS

To obtain permission to save, you must set NSPhotLibraryUsageDescription in the info.plist of the project you wish to use.

<key>NSPhotoLibraryUsageDescription</key>
<string>Why authority is needed</string>

Android

uses-permission is set in the internal AndroidManifest.

Example

File file = File("Path of the file you want to save.");

MediaGallerySaver().saveMediaFromFile(
  file,
  quality: 100, // default 100%
);