fc_file_picker_util

Last updated:

0 purchases

fc_file_picker_util Image
fc_file_picker_util Images
Add to Cart

Description:

fc file picker util

fc_file_picker_util #





Windows
macOS
iOS
Android




Pick files






Pick a folder






Pick a save path







File pickers based on file_selector with the following differences:

Support picking a directory on iOS.
Picking a directory on macOS can be configured to return a path or a URL.

Usage #
macOS #
You need to add the following key to entitlements in order for macOS app to be able to access file system:
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
copied to clipboard
Pick files #
/// Picks a file and return a
/// [XFile](https://pub.dev/documentation/cross_file/latest/cross_file/XFile-class.html).
final file = await FcFilePickerUtil.pickFile();

/// Picks multiple files and return a list of
/// [XFile](https://pub.dev/documentation/cross_file/latest/cross_file/XFile-class.html).
final files = await FcFilePickerUtil.pickMultipleFiles();
copied to clipboard
Pick a folder #
/// Picks a folder and return a [FilePickerXResult].
///
/// [macOSScoped] whether to return URL on macOS. If false, returns path. On iOS,
/// URL is always returned.
final folder = await FcFilePickerUtil.pickFolder(macOSScoped: false);
copied to clipboard
The result (FilePickerXResult) can be a URI or path depending on the platform:

Windows: path
macOS: URL if macOSScoped is true, otherwise path
iOS: URL

Note: you might need to call startAccessingSecurityScopedResource to gain access to the directory on iOS.


Android: An SAF Uri

Pick a save path #
/// Picks a save file location and return a [String] path.
/// You can optionally specify a default file name.
final savePath = await FcFilePickerUtil.pickSaveFile();
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.