Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit fac8fb1

Browse files
committed
Update README
1 parent 7d4cdf2 commit fac8fb1

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

packages/file_selector/file_selector/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 0.9.3
22

3+
* Improves API docs and examples.
34
* Updates minimum Flutter version to 2.10.
45

56
## 0.9.2

packages/file_selector/file_selector/README.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ A Flutter plugin that manages files and interactions with file dialogs.
1010
|-------------|--------|-------|--------|-----|-------------|
1111
| **Support** | iOS 9+ | Any | 10.11+ | Any | Windows 10+ |
1212

13-
## Usage
13+
# Usage
14+
1415
To use this plugin, add `file_selector` as a [dependency in your pubspec.yaml file](https://flutter.dev/platform-plugins/).
1516

16-
### macOS
17+
## macOS
1718

1819
You will need to [add an entitlement][entitlement] for either read-only access:
1920
```xml
@@ -27,11 +28,23 @@ or read/write access:
2728
```
2829
depending on your use case.
2930

30-
### Examples
31+
# Feature supported platform
32+
Features support by platform:
33+
34+
| Feature | iOS | Linux | macOS | Windows | Android |
35+
| -------------------- |--------- | --------- | --------- | ----------- | -------- |
36+
| Open a single file | ✔️ | ✔️ | ✔️ | ✔️ ||
37+
| Open multiple files | ✔️ | ✔️ | ✔️ | ✔️ ||
38+
| Saving a file || ✔️ | ✔️ | ✔️ ||
39+
| Get directory path || ✔️ | ✔️ | ✔️ ||
40+
41+
# Example
42+
3143
Here are small examples that show you how to use the API.
3244
Please also take a look at our [example][example] app.
3345

34-
#### Open a single file
46+
## Open a single file
47+
3548
<?code-excerpt "open_image_page.dart (SingleOpen)"?>
3649
``` dart
3750
final XTypeGroup typeGroup = XTypeGroup(
@@ -42,7 +55,7 @@ final XFile? file =
4255
await openFile(acceptedTypeGroups: <XTypeGroup>[typeGroup]);
4356
```
4457

45-
#### Open multiple files at once
58+
## Open multiple files at once
4659
<?code-excerpt "open_multiple_images_page.dart (MultiOpen)"?>
4760
``` dart
4861
final XTypeGroup jpgsTypeGroup = XTypeGroup(
@@ -59,7 +72,8 @@ final List<XFile> files = await openFiles(acceptedTypeGroups: <XTypeGroup>[
5972
]);
6073
```
6174

62-
#### Saving a file
75+
## Saving a file
76+
6377
<?code-excerpt "readme_standalone_excerpts.dart (Save)"?>
6478
```dart
6579
const String fileName = 'suggested_name.txt';
@@ -76,6 +90,15 @@ final XFile textFile =
7690
await textFile.saveTo(path);
7791
```
7892

93+
## Get directory path
94+
95+
<?code-excerpt "get_directory_page.dart (GetDirectory)"?>
96+
```dart
97+
const String confirmButtonText = 'Choose';
98+
final String? directoryPath = await getDirectoryPath(
99+
confirmButtonText: confirmButtonText,
100+
);
101+
```
79102
### Filtering by file types
80103

81104
Different platforms support different type group filter options. To avoid
@@ -93,4 +116,4 @@ pass different `XTypeGroup`s based on `Platform`.
93116
`mimeTypes` are not supported on version of macOS earlier than 11 (Big Sur).
94117

95118
[example]:./example
96-
[entitlement]: https://docs.flutter.dev/desktop#entitlements-and-the-app-sandbox
119+
[entitlement]: https://docs.flutter.dev/desktop#entitlements-and-the-app-sandbox

packages/file_selector/file_selector/example/lib/get_directory_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ class GetDirectoryPage extends StatelessWidget {
1414
final bool _isIOS = !kIsWeb && defaultTargetPlatform == TargetPlatform.iOS;
1515

1616
Future<void> _getDirectoryPath(BuildContext context) async {
17+
// #docregion GetDirectory
1718
const String confirmButtonText = 'Choose';
1819
final String? directoryPath = await getDirectoryPath(
1920
confirmButtonText: confirmButtonText,
2021
);
22+
// #enddocregion GetDirectory
2123
if (directoryPath == null) {
2224
// Operation was canceled by the user.
2325
return;

packages/file_selector/file_selector/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for opening and saving files, or selecting
33
directories, using native file selection UI.
44
repository: https://github.com/flutter/plugins/tree/main/packages/file_selector/file_selector
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
6-
version: 0.9.2
6+
version: 0.9.3
77

88
environment:
99
sdk: ">=2.12.0 <3.0.0"

0 commit comments

Comments
 (0)