flutter_file_picker/README.md

81 lines
3.8 KiB
Markdown
Raw Normal View History

![fluter_file_picker](https://user-images.githubusercontent.com/27860743/64064695-b88dab00-cbfc-11e9-814f-30921b66035f.png)
2019-11-17 14:11:01 +00:00
<p align="center">
<a href="https://pub.dartlang.org/packages/file_picker">
<img alt="File Picker" src="https://img.shields.io/pub/v/file_picker.svg">
</a>
<a href="https://github.com/Solido/awesome-flutter">
<img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square">
</a>
<a href="https://codemagic.io/apps/5ce89f4a9b46f5000ca89638/5ce89f4a9b46f5000ca89637/latest_build">
<img alt="Build Status" src="https://api.codemagic.io/apps/5ce89f4a9b46f5000ca89638/5ce89f4a9b46f5000ca89637/status_badge.svg">
</a>
<a href="https://www.buymeacoffee.com/gQyz2MR">
<img alt="Buy me a coffee" src="https://img.shields.io/badge/Donate-Buy%20Me%20A%20Coffee-yellow.svg">
</a>
</p>
# 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.
2018-12-27 14:02:24 +00:00
## Currently supported features
* Load paths from **cloud files** (GDrive, Dropbox, iCloud)
* Load path from a **custom format** by providing a list of file extensions (pdf, svg, zip, etc.)
* Load path from **multiple files** optionally, supplying file extensions
* Load path from **media** (video & image only)
* Load path from **audio** only
* Load path from **image** only
* Load path from **video** only
* Load path from **any**
* Create a `File` or `List<File>` objects from **any** selected file(s)
* Supports desktop through **go-flutter** (MacOS, Windows, Linux)
2019-06-24 10:10:19 +00:00
If you have any feature that you want to see in this package, please add it [here](https://github.com/miguelpruivo/plugins_flutter_file_picker/issues/99). 🎉
## Documentation
See the **[File Picker Wiki](https://github.com/miguelpruivo/flutter_file_picker/wiki)** for every detail on about how to install, setup and use it.
1. [Installation](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Installation)
2. [Setup](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup)
* [Android](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup#android)
* [iOS](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup#ios)
* [Desktop (go-flutter)](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup/_edit#desktop-go-flutter)
3. [API](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/api)
* [Filters](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/API#filters)
* [Methods](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/API#methods)
2019-08-31 15:34:52 +00:00
4. [Example App](https://github.com/miguelpruivo/flutter_file_picker/blob/master/example/lib/src/file_picker_demo.dart)
5. [Troubleshooting](https://github.com/miguelpruivo/flutter_file_picker/wiki/Troubleshooting)
2019-11-17 14:11:01 +00:00
## Usage
Quick simple usage example:
#### Single file
```
File file = await FilePicker.getFile();
2019-11-17 14:11:01 +00:00
```
#### Multiple files
```
List<File> files = await FilePicker.getMultiFile();
```
#### Multiple files with extension filter
```
List<File> files = await FilePicker.getMultiFile(
type: FileType.custom,
allowedExtensions: ['jpg', 'pdf', 'doc'],
);
```
2019-11-17 14:11:01 +00:00
For full usage details refer to the **[Wiki](https://github.com/miguelpruivo/flutter_file_picker/wiki)** above.
## Example App
![Demo](https://github.com/miguelpruivo/plugins_flutter_file_picker/blob/master/example/example.gif)
![DemoMultiFilters](https://github.com/miguelpruivo/plugins_flutter_file_picker/blob/master/example/example_ios.gif)
2018-06-23 01:22:04 +00:00
## Getting Started
For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).