add_to_gallery 0.1.0+3
add_to_gallery: ^0.1.0+3 copied to clipboard
Adds images to Android Gallery and iOS Photos
Add to Gallery #
Adds images and videos to the Android Gallery and iOS Photos

View example app
Installation #
Add add_to_gallery
as a dependency in your pubspec.yaml file.
iOS #
Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist
:
NSPhotoLibraryUsageDescription
- describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
Android #
android.permission.WRITE_EXTERNAL_STORAGE
- Permission for usage of external storage
Usage #
There's only one method, it returns the new path to the file in the gallery:
File file = File('/Some/Media/Path.jpg');
String path = await AddToGallery.addToGallery(
originalFile: file,
albumName: 'My Awesome App',
deleteOriginalFile: false,
);
print(path);
Important Note about Google photos #
Google Photos has a built-in feature to remove exact duplicates. This can be confusing behaviour. I considered addressing this behaviour in the plugin, but decided against it. But it's worth pointing out anyhow!
Credits #
Add to Gallery is based on gallery_saver with some notable differences. Enough to warrant a new package rather than a pull-request.
Feature |
add_to_gallery
this package |
gallery_saver
original package |
---|---|---|
Return Formats |
|
|
Temporary Files |
|
|
Remote Files (over http) |
|
|
Album Name |
|
|
Image Manipulation |
|
|