AppFlowy-IO / AppFlowy-IO/appflowy-editor

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

Abierto
#1,180 5 comentarios 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
684
Forks
329
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.