file_picker_darwin 1.1.0 copy "file_picker_darwin: ^1.1.0" to clipboard
file_picker_darwin: ^1.1.0 copied to clipboard

PlatformiOSmacOS

Darwin (iOS and macOS) implementation of the file_picker plugin, supporting native file picking, saving, and directory selection.

file_picker_darwin #

The iOS and macOS implementation of file_picker.

Usage #

This package is endorsed, which means you can simply use file_picker as normal, and the iOS and macOS implementations will be automatically included.

macOS setup #

A sandboxed macOS app needs a files entitlement before the picker can return a usable path, without it every pick or save fails with an entitlement error. Add one of the following to both macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements, depending on whether your app only needs to read picked files or also needs to write to them:

Read-only access:

<key>com.apple.security.files.user-selected.read-only</key>
<true/>

Read and write access (required for saveFile()):

<key>com.apple.security.files.user-selected.read-write</key>
<true/>

You can also add these from Xcode, under your target's Signing & Capabilities tab, in the App Sandbox section.

Pick iOS media using its current representation

List<PlatformFile> files = await FilePicker.pickFiles(
  type: FileType.video,
  compressionQuality: 0,
  darwinOptions: const DarwinOptions(
    assetRepresentationMode: DarwinAssetRepresentationMode.current,
  ),
);

The available modes are automatic (the default), current, and compatible. This option applies only to the iOS photo-library picker. Non-automatic modes require compressionQuality to be 0.

0
likes
160
points
244k
downloads

Documentation

API reference

Publisher

verified publishervictorcarreras.dev

Weekly Downloads

Darwin (iOS and macOS) implementation of the file_picker plugin, supporting native file picking, saving, and directory selection.

Repository (GitHub)
View/report issues
Contributing

Topics

#file-picker #ios #macos #darwin

License

MIT (license)

Dependencies

cross_file, file_picker_platform_interface, flutter, path

More

Packages that depend on file_picker_darwin

Packages that implement file_picker_darwin