- Notifications
You must be signed in to change notification settings - Fork0
File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
License
ViscousPot/flutter_file_picker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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
- Supports multiple platforms (Mobile, Web, Desktop)
- Pick files usingcustom format filtering — you can provide a list of file extensions (pdf, svg, zip, etc.)
- Pick files fromcloud files (GDrive, Dropbox, iCloud)
- Single or multiple file picks
- Supports retrieving as XFile (cross_file) for easy manipulation with other libraries
- Different default type filtering (media, image, video, audio or any)
- Picking directories
- Picking both files and directories simultaneously
- Load file data immediately into memory (
Uint8List) if needed; - Open a save-file / save-as dialog (a dialog that lets the user specify the drive, directory, and name of a file to save)
If you have any feature that you want to see in this package, please feel free to issue a suggestion. 🎉
| API | Android | iOS | Linux | macOS | Windows | Web |
|---|---|---|---|---|---|---|
clearTemporaryFiles() | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
getDirectoryPath() | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
pickFileAndDirectoryPaths() | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ |
pickFiles() | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
saveFile() | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
See theAPI section of the File Picker Wiki or theofficial API reference on pub.dev for further details.
See theFile Picker Wiki for every detail on about how to install, setup and use it.
Quick simple usage example:
FilePickerResult? result=awaitFilePicker.platform.pickFiles();if (result!=null) {File file=File(result.files.single.path!);}else {// User canceled the picker}
FilePickerResult? result=awaitFilePicker.platform.pickFiles(allowMultiple:true);if (result!=null) {List<File> files= result.paths.map((path)=>File(path!)).toList();}else {// User canceled the picker}
FilePickerResult? result=awaitFilePicker.platform.pickFiles( allowMultiple:true, type:FileType.custom, allowedExtensions: ['jpg','pdf','doc'],);
String? selectedDirectory=awaitFilePicker.platform.getDirectoryPath();if (selectedDirectory==null) {// User canceled the picker}
String? outputFile=awaitFilePicker.platform.saveFile( dialogTitle:'Please select an output file:', fileName:'output-file.pdf',);if (outputFile==null) {// User canceled the picker}
FilePickerResult? result=awaitFilePicker.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}
FilePickerResult? result=awaitFilePicker.platform.pickFiles();if (result!=null) {// All filesList<XFile> xFiles= result.xFiles;// IndividuallyXFile xFile= result.files.first.xFile;}else {// User canceled the picker}
FilePickerResult? result=awaitFilePicker.platform.pickFiles();if (result!=null) {Uint8List fileBytes= result.files.first.bytes;String fileName= result.files.first.name;// Upload fileawaitFirebaseStorage.instance.ref('uploads/$fileName').putData(fileBytes);}
For full usage details refer to theWiki above.
For help getting started with Flutter, view our onlinedocumentation.
For help on editing plugin code, view thedocumentation.
About
File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- Dart48.0%
- Objective-C16.6%
- Kotlin13.8%
- C++8.4%
- CMake7.0%
- Swift4.5%
- Other1.7%





