AppFlowy-IO / AppFlowy-IO/appflowy-editor

Bug: Flutter Web build fails with latest file_picker – FilePicker.platform removed

オープン
#1,180 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Dart
スター
684
フォーク
329
PR マージ指標
30日以内にマージされた PR はありません

説明

### Bug Description

Flutter Web builds fail when using appflowy_editor 6.2.0 together with recent versions of the file_picker package.

The issue occurs because appflowy_editor still uses the deprecated/removed API:

FilePicker.platform

This API no longer exists in recent file_picker versions (e.g. >=10.3.9), causing compile-time errors for Flutter Web (both dart2js and dart2wasm).

### How to Reproduce

Create a Flutter Web project

Add appflowy_editor: 6.2.0

Allow file_picker to resolve to a recent version (e.g. ^10.3.6)

Run:

flutter build web

Build fails during compilation

### Expected Behavior

appflowy_editor should use the new cross-platform file_picker APIs:

FilePicker.pickFiles()
FilePicker.saveFile()
FilePicker.getDirectoryPath()

so it remains compatible with current and future file_picker releases, especially on Flutter Web.

### Operating System

Environment Flutter: 3.38.1 (stable) Dart: 3.10.0 Platform: Web (dart2js / dart2wasm) appflowy_editor: 6.2.0 file_picker: >= 10.3.9 (resolved transitively)

### AppFlowy Editor Version(s)

appflowy_editor: ^6.1.0

### Screenshots

_No response_

### Additional Context

Error: Member not found: 'platform'.
fp.FilePicker.platform.pickFiles()
fp.FilePicker.platform.saveFile()
fp.FilePicker.platform.getDirectoryPath()

Source:
lib/src/editor/util/file_picker/file_picker_impl.dart

Suggested fix

Update appflowy_editor to remove all usages of FilePicker.platform

Use the new static APIs provided by file_picker

Optionally add an upper bound constraint for file_picker until compatibility is ensured

Additional context

This issue started appearing immediately after file_picker 10.3.9 was published, without any code changes on the app side, due to caret (^) dependency resolution.

Thanks for maintaining AppFlowy Editor 🙏
Happy to test or submit a PR if needed.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。