Skip to content

File picker plugin for Flutter, compatible with both iOS & Android and desktop (go-flutter).

License

Notifications You must be signed in to change notification settings

pspatel602/flutter_file_picker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fluter_file_picker

File Picker Awesome Flutter Build Status Buy me a coffee

File Picker

A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extensions filtering support.

Currently supported features

  • Load files from cloud files (GDrive, Dropbox, iCloud)
  • Load files from a custom format by providing a list of file extensions (pdf, svg, zip, etc.)
  • Load files from multiple files optionally, supplying file extensions
  • Load files from media (video & image only)
  • Load files from audio only
  • Load files from image only
  • Load files from video only
  • Load files from directory
  • Load files from any
  • Load files data immediately to memory (Uint8List);
  • Supports web;
  • Supports desktop through go-flutter (MacOS, Windows, Linux)

If you have any feature that you want to see in this package, please feel free to issue a suggestion. 🎉

Documentation

See the File Picker Wiki for every detail on about how to install, setup and use it.

File Picker Wiki

  1. Installation
  2. Setup
  3. API
  4. Troubleshooting

Usage

Quick simple usage example:

Single file

FilePickerResult result = await FilePicker.platform.pickFiles();

if(result != null) {
   File file = File(result.files.single.path);
}

Multiple files

FilePickerResult result = await FilePicker.platform.pickFiles(allowMultiple: true);

if(result != null) {
   List<File> files = result.paths.map((path) => File(path)).toList();
}

Multiple files with extension filter

FilePickerResult result = await FilePicker.platform.pickFiles(
          type: FileType.custom,
          allowedExtensions: ['jpg', 'pdf', 'doc'],
        );

Load result and file details

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);
}

For full usage details refer to the Wiki above.

Example App

Demo DemoMultiFilters

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

About

File picker plugin for Flutter, compatible with both iOS & Android and desktop (go-flutter).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 36.1%
  • Objective-C 27.1%
  • Dart 22.1%
  • Go 8.1%
  • Ruby 5.0%
  • HTML 1.1%
  • Other 0.5%