A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support.
- Uses OS default native pickers
- Pick files using custom format filtering — you can provide a list of file extensions (pdf, svg, zip, etc.)
- Pick files from cloud files (GDrive, Dropbox, iCloud)
- Single or multiple file picks
- Different default type filtering (media, image, video, audio or any)
- Picking directories
- Flutter Web
- Desktop (MacOS, Linux and Windows through Flutter Go)
- Load file data immediately into memory (
Uint8List
) if needed;
If you have any feature that you want to see in this package, please feel free to issue a suggestion. 🎉
See the File Picker Wiki for every detail on about how to install, setup and use it.
Quick simple usage example:
FilePickerResult result = await FilePicker.platform.pickFiles();
if(result != null) {
File file = File(result.files.single.path);
} else {
// User canceled the picker
}
FilePickerResult result = await FilePicker.platform.pickFiles(allowMultiple: true);
if(result != null) {
List<File> files = result.paths.map((path) => File(path)).toList();
} else {
// User canceled the picker
}
FilePickerResult result = await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['jpg', 'pdf', 'doc'],
);
FilePickerResult result = await FilePicker.platform.pickFiles();
if(result != null) {
PlatformFile file = result.files.first;
print(file.name);
print(file.bytes);
print(file.size);
print(file.extension);
print(file.path);
} else {
// User canceled the picker
}
For full usage details refer to the Wiki above.
For help getting started with Flutter, view our online documentation.
For help on editing plugin code, view the documentation.