-
Notifications
You must be signed in to change notification settings - Fork 707
Setup
All set, you should be ready to go as long as you concede runtime permissions (included with the plugin)!
Note: If your are overriding onActivityResult
in your MainActivity, make sure to call super.onActivityResult(...)
for unhandled activities. Otherwise picking a file might fail silently.
Since 1.7.0
sub-dependencies, you will need to add use_frameworks!
to your <project root>/ios/Podfile
.
target 'Runner' do
use_frameworks!
Based on the location of the files that you are willing to pick paths, you may need to add some keys to your iOS app's Info.plist file, located in <project root>/ios/Runner/Info.plist
:
-
UIBackgroundModes with the fetch and remote-notifications keys - Required if you'll be using the
FileType.any
orFileType.custom
. Describe why your app needs to access background taks, such downloading files (from cloud services). This is called Required background modes, with the keys App download content from network and App downloads content in response to push notifications respectively in the visual editor (since both methods aren't actually overriden, not adding this property/keys may only display a warning, but shouldn't prevent its correct usage).<key>UIBackgroundModes</key> <array> <string>fetch</string> <string>remote-notification</string> </array>
-
NSAppleMusicUsageDescription - Required if you'll be using the
FileType.audio
. Describe why your app needs permission to access music library. This is called Privacy - Media Library Usage Description in the visual editor.<key>NSAppleMusicUsageDescription</key> <string>Explain why your app uses music</string>
-
NSPhotoLibraryUsageDescription - Required if you'll be using the
FileType.image
orFileType.video
. Describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.<key>NSPhotoLibraryUsageDescription</key> <string>Explain why your app uses photo library</string>
Note: Any iOS version below 11.0, will require an Apple Developer Program account to enable CloudKit and make it possible to use the document picker (which happens when you select FileType.all
, FileType.custom
or any other option with getMultiFilePath()
). You can read more about it here.
As of today (12/06/2020) you must be on beta
channel and have web support enabled:
flutter channel beta
flutter doctor -v
flutter config --enable-web
- Because go-flutter uses Go, you will need to install Go by following these steps.
- Then, follow these instructions to install hover on your machine.
- Now you should have all set to start with your Flutter desktop project, by following these instructions as well. If for some reason the
hover
commands don't work for you, just make sure you haven't missed anything from the setup. - Go to your
projectName/go/cmd/options.go
and add the following lines
package main
import (
... other imports ....
file_picker "github.com/miguelpruivo/flutter_file_picker/go"
)
var options = []flutter.Option{
... other plugins and options ...
flutter.AddPlugin(&file_picker.FilePickerPlugin{}),
}
- All set, just do
hover run
and you should have your app running on Desktop with FilePicker plugin.