@@ -11,6 +11,7 @@ A Flutter plugin that manages files and interactions with file dialogs.
1111| ** Support** | iOS 9+ | Any | 10.11+ | Any | Windows 10+ |
1212
1313## Usage
14+
1415To use this plugin, add ` file_selector ` as a [ dependency in your pubspec.yaml file] ( https://flutter.dev/platform-plugins/ ) .
1516
1617### macOS
@@ -27,11 +28,13 @@ or read/write access:
2728```
2829depending on your use case.
2930
30- ### Examples
31+ ### Example
32+
3133Here are small examples that show you how to use the API.
3234Please also take a look at our [ example] [ example ] app.
3335
3436#### Open a single file
37+
3538<? code-excerpt "open_image_page.dart (SingleOpen)"?>
3639``` dart
3740final XTypeGroup typeGroup = XTypeGroup(
@@ -43,6 +46,7 @@ final XFile? file =
4346```
4447
4548#### Open multiple files at once
49+
4650<? code-excerpt "open_multiple_images_page.dart (MultiOpen)"?>
4751``` dart
4852final XTypeGroup jpgsTypeGroup = XTypeGroup(
@@ -59,7 +63,8 @@ final List<XFile> files = await openFiles(acceptedTypeGroups: <XTypeGroup>[
5963]);
6064```
6165
62- #### Saving a file
66+ #### Save a file
67+
6368<? code-excerpt "readme_standalone_excerpts.dart (Save)"?>
6469``` dart
6570const String fileName = 'suggested_name.txt';
@@ -76,6 +81,17 @@ final XFile textFile =
7681await textFile.saveTo(path);
7782```
7883
84+ #### Get a directory path
85+
86+ <? code-excerpt "readme_standalone_excerpts.dart (GetDirectory)"?>
87+ ``` dart
88+ final String? directoryPath = await getDirectoryPath();
89+ if (directoryPath == null) {
90+ // Operation was canceled by the user.
91+ return;
92+ }
93+ ```
94+
7995### Filtering by file types
8096
8197Different platforms support different type group filter options. To avoid
@@ -92,5 +108,14 @@ pass different `XTypeGroup`s based on `Platform`.
92108
93109† ` mimeTypes ` are not supported on version of macOS earlier than 11 (Big Sur).
94110
111+ ### Features supported by platform
112+
113+ | Feature | iOS | Linux | macOS | Windows | Web |
114+ | ---------------------- | --------- | ---------- | -------- | ------------ | ----------- |
115+ | Open a single file | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
116+ | Open multiple files | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
117+ | Save a file | ❌ | ✔️ | ✔️ | ✔️ | ❌ |
118+ | Get a directory path | ❌ | ✔️ | ✔️ | ✔️ | ❌ |
119+
95120[ example ] :./example
96- [ entitlement ] : https://docs.flutter.dev/desktop#entitlements-and-the-app-sandbox
121+ [ entitlement ] : https://docs.flutter.dev/desktop#entitlements-and-the-app-sandbox
0 commit comments