# 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:
```xml
com.apple.security.files.user-selected.read-only
```
Read and write access (required for `saveFile()`):
```xml
com.apple.security.files.user-selected.read-write
```
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
```dart
List 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`.