Last updated:
0 purchases
flutter gallery picker
Flutter Gallery Picker #
This a Flutter Gallery which allows you to pick image or video from gallery.
Features #
Here are some features:
Easy, lightweight, open-source.
Flutter Native Screens
Gallery Like Screens
Preview Image
MIT licensed.
Easily extensible.
Getting Started #
Installing #
Add this to your package's pubspec.yaml file:
dependencies:
flutter_gallery_picker: ^0.0.4
copied to clipboard
Import #
import 'package:flutter_gallery_picker/flutter_gallery_picker.dart';
copied to clipboard
How to use #
Android #
Add the following permissions to your AndroidManifest.xml, located in <project root>/android/app/src/main/AndroidManifest.xml:
<manifest ...>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
...
<manifest/>
copied to clipboard
API 29+
Add the following property to your AndroidManifest.xml, located in <project root>/android/app/src/main/AndroidManifest.xml to opt-out of scoped storage:
<manifest ...>
...
<application
android:requestLegacyExternalStorage="true"
...>
<application/>
<manifest/>
copied to clipboard
Usage #
Single #
File image = await GalleryScreen.getImage(context);
print(image);
copied to clipboard
you can use the image as File
getImage() async {
File image = await GalleryScreen.getImage(context);
// print image path
print(image.path);
// from package rflutter_alert
Alert(
context: context,
// show image from file (image)
content: Image.file(image),
).show();
}
copied to clipboard
Multi #
you can get List<File>
List<File> images = await GalleryScreen.getImage(context , multi:true);
print(images);
copied to clipboard
getImage() async {
List<File> images = await GalleryScreen.getImage(context , multi:true);
// print images list
print(images);
// from package rflutter_alert
Alert(
context: context,
// show image from file (image)
content: Image.file(image.first),
).show();
}
copied to clipboard
it's really easy :)
You can say Thank You, Donate to the developer.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.