fc_file_picker_util 0.0.2 copy "fc_file_picker_util: ^0.0.2" to clipboard
fc_file_picker_util: ^0.0.2 copied to clipboard

File pickers based on [file_selector].

fc_file_picker_util #

pub package

Windows macOS iOS Android
Pick files
Pick a folder
Pick a save path

File pickers based on file_selector with the following differences:

  • Supports picking directory on iOS.
  • Supports picking save path on Android and iOS.
  • Picking folder on macOS can be configured to return a path or a URL.

Usage #

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

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

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
  • 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();