Skip to content

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

@hassanali-plumoai

Description

@hassanali-plumoai

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions