Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Almost all apps should only ever depend on `file_picker` directly. The platform

```yaml
dependencies:
file_picker: ^12.0.0
file_picker: ^13.0.0
```

```dart
Expand All @@ -52,15 +52,21 @@ final file = await FilePicker.pickFile();

if (file != null) {
print(file.name);
print(await file.length());
print(await file.length()); // Returns Future<int?> (or use file.lengthSync())
}
```

See [`packages/file_picker/README.md`](packages/file_picker/README.md) for the full feature list, platform compatibility chart, and more usage examples (multiple files, extension filters, directory picking, save-file dialogs).

## Migration

- **Upgrading to v13?** See the [Migrating to v13 Guide](packages/file_picker/README.md#migrating-to-v13) for details on `PlatformFile.length()` returning `Future<int?>` and the removal of legacy v12-deprecated parameters.
- **Upgrading from pre-v12?** See the [Migrating to v12 Guide](packages/file_picker/README.md#migrating-to-v12) for the federated architecture changes (`FilePicker.pickFiles()` returning `List<PlatformFile>`, platform options, and streaming).

## Documentation

- [`packages/file_picker/README.md`](packages/file_picker/README.md) for usage and the platform compatibility chart, and each platform package's own README for platform-specific setup (e.g. [`file_picker_darwin`](packages/file_picker_darwin/README.md) for macOS entitlements).
- [`packages/file_picker/README.md`](packages/file_picker/README.md) for usage, platform compatibility chart, and [migration guides](packages/file_picker/README.md#migrating-to-v13).
- Platform-specific setup in each package's README (e.g. [`file_picker_darwin`](packages/file_picker_darwin/README.md) for macOS entitlements, [`android_file_picker`](packages/file_picker_android/README.md) for Android notes).
- [API reference on pub.dev](https://pub.dev/documentation/file_picker/latest/file_picker/FilePicker-class.html).
- [`packages/file_picker/CHANGELOG.md`](packages/file_picker/CHANGELOG.md) and each platform package's own `CHANGELOG.md` for release notes.

Expand Down
14 changes: 7 additions & 7 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ versions are not patched, so if you are on one, the fix will be an upgrade.

| Package | Supported |
| --- | --- |
| `file_picker` | Latest 12.x |
| `file_picker_platform_interface` | Latest 3.x |
| `android_file_picker` | Latest 1.x |
| `file_picker_darwin` | Latest 1.x |
| `file_picker_linux` | Latest 1.x |
| `file_picker_web` | Latest 3.x |
| `windows_file_picker` | Latest 1.x |
| `file_picker` | Latest 13.x |
| `file_picker_platform_interface` | Latest 4.x |
| `android_file_picker` | Latest 2.x |
| `file_picker_darwin` | Latest 2.x |
| `file_picker_linux` | Latest 2.x |
| `file_picker_web` | Latest 4.x |
| `windows_file_picker` | Latest 2.x |

## What is in scope

Expand Down
7 changes: 7 additions & 0 deletions packages/file_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
### General
- **BREAKING CHANGE**: `PlatformFile.length()` now returns `Future<int?>` instead of `Future<int>`, matching `lengthSync()`. `null` means the length could not be determined (e.g. a failed disk read), distinct from a genuinely empty file, which still returns `0`. Previously both cases returned `0`, with no way to tell them apart. [#2197](https://github.com/vicajilau/flutter_file_picker/issues/2197)
- **BREAKING CHANGE**: Removed the parameters deprecated since the 12.0.0 federated rewrite: `allowMultiple` and `withData`/`withReadStream`/`readSequential` on `pickFiles()`, `lockParentWindow` on `pickFiles()`/`pickFile()`/`getDirectoryPath()`/`saveFile()`, `cancelUploadOnWindowBlur` on `pickFiles()`/`pickFile()`, and `androidSafOptions` on `pickFiles()`/`pickFile()`/`getDirectoryPath()`. Use `pickFile()` for single-file selection, `PlatformFile.readAsBytes()`/`readAsByteStream()` to read file data, `WindowsOptions.lockParentWindow`/`LinuxOptions.lockParentWindow`, `WebOptions.cancelUploadOnWindowBlur`, and `androidOptions` respectively. [#2202](https://github.com/vicajilau/flutter_file_picker/issues/2202)
- Raised lower bounds of all platform implementation packages: `file_picker_platform_interface ^4.0.0`, `android_file_picker ^2.0.0`, `file_picker_darwin ^2.0.0`, `file_picker_linux ^2.0.0`, `windows_file_picker ^2.0.0`, and `file_picker_web ^4.0.0`.

### Web
- Fixed `FilePickerWebOptions.readSequential` having no effect (`file_picker_web 4.0.0`). [#2206](https://github.com/vicajilau/flutter_file_picker/issues/2206)

### Android & iOS
- Removed the dead native code paths behind `withData` (`android_file_picker 2.0.0`, `file_picker_darwin 2.0.0`). [#2202](https://github.com/vicajilau/flutter_file_picker/issues/2202)

## 12.3.0

Expand Down
5 changes: 3 additions & 2 deletions packages/file_picker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![File Picker](https://raw.githubusercontent.com/vicajilau/flutter_file_picker/main/.github/assets/readme_banner.svg)
<p align="center">
<a href="https://pub.dartlang.org/packages/file_picker">
<a href="https://pub.dev/packages/file_picker">
<img alt="File Picker" src="https://img.shields.io/pub/v/file_picker.svg">
</a>
<a href="https://github.com/Solido/awesome-flutter">
Expand Down Expand Up @@ -59,9 +59,10 @@ The iOS and macOS native implementations live under the shared Darwin source tre
- `null` means the length could not be determined (e.g. a failed disk read), distinct from a genuinely empty file, which still returns `0`.
- **v12**: `int bytes = await file.length();`
- **v13**: `int? bytes = await file.length();`
- **Tip**: You can also use `int? syncBytes = file.lengthSync();` to get the length immediately without disk I/O when already reported by the native picker, or combine them: `file.lengthSync() ?? await file.length()`.

2. **Removed Parameters Deprecated Since v12**:
- `allowMultiple`, `withData`, `withReadStream`, and `readSequential` on `pickFiles()`/`pickFile()`: use `pickFile()` for single-file selection, and `PlatformFile.readAsBytes()`/`readAsByteStream()` to read file data.
- `allowMultiple`, `withData`, `withReadStream`, and `readSequential` on `pickFiles()`: use `pickFile()` for single-file selection, and `PlatformFile.readAsBytes()`/`readAsByteStream()` to read file data.
- `lockParentWindow` on `pickFiles()`/`pickFile()`/`getDirectoryPath()`/`saveFile()`: use `WindowsOptions.lockParentWindow` or `LinuxOptions.lockParentWindow`.
- `cancelUploadOnWindowBlur` on `pickFiles()`/`pickFile()`: use `WebOptions.cancelUploadOnWindowBlur`.
- `androidSafOptions` on `pickFiles()`/`pickFile()`/`getDirectoryPath()`: use `androidOptions`.
Expand Down
6 changes: 0 additions & 6 deletions packages/file_picker_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
## 2.0.0

#### Desktop (Windows)

- **BREAKING CHANGE**: `PlatformFile.length()` now returns `Future<int?>` instead of `Future<int>`. Returns `null` when the length could not be determined (e.g. a failed disk read), instead of `0`, matching `lengthSync()`. [#2197](https://github.com/vicajilau/flutter_file_picker/issues/2197)

## 1.3.0

#### Desktop (Windows)

- Added `WindowsOptions.acceptLabel`, letting callers set the confirm ("OK") button text on `pickFile()`, `pickFiles()`, `getDirectoryPath()`, and `saveFile()` dialogs, via `IFileDialog.SetOkButtonLabel`. [#1861](https://github.com/vicajilau/flutter_file_picker/issues/1861)

## 1.2.0

#### Desktop (Windows)

- Implemented `PlatformFile.lengthSync()`. The picker only returns a file path, not its size, so this returns `null` on Windows, use `length()` to actually read it from disk.

## 1.1.0
Expand Down
Loading