0 purchases
awesome gallery saver
awesome_gallery_saver #
Save images or videos to the gallery.
Usage #
To use this plugin, add awesome_gallery_saver as a dependency in your pubspec.yaml file. For example:
dependencies:
awesome_gallery_saver: ^0.0.6
copied to clipboard
iOS #
Your project need create with swift.
Add the following keys to your Info.plist file, located in
NSPhotoLibraryAddUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Additions Usage Description in the visual editor
Android #
You need to ask for storage permission to save an image to the gallery. You can handle the storage permission using flutter_permission_handler.
In Android version 10, Open the manifest file and add this line to your application tag
<application android:requestLegacyExternalStorage="true" .....>
copied to clipboard
Example #
Saving an image from the internet, quality and name is option
Future<void> _saveImage() async {
final Response<dynamic> response = await Dio().get(
"https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-8-1200.jpg",
options: Options(responseType: ResponseType.bytes));
final result = await GallerySaver.saveImage(
Uint8List.fromList(response.data),
quality: 60,
name: "hello",
);
print(result);
}
copied to clipboard
Saving file(ig: images/video/gif/others) from the internet
Future<void> _saveFile() async {
final appDocDir = await getTemporaryDirectory();
String savePath = appDocDir.path + "/image.jpg";
await Dio().download("https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-8-1200.jpg", savePath);
final result = await GallerySaver.saveFile(savePath);
print(result);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.