[Feature Request]: WASM compatibility & modularizing core LlmProvider interfaces
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start by locating the LlmProvider, ChatMessage, and Attachment definitions and inspecting the package exports and dependencies; the issue does not name their files. Then check which dependency blocks flutter build web --wasm and whether the core contracts can be exported without UI or plugin dependencies. Done means a documented decision and implementation for WASM compatibility, a lightweight contract export, or both, with the stated build target verified.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Use Case & Problem Description
We are developing downstream packages and applications implementing custom LlmProvider backends (such as multi-provider routers and failover managers) designed to drop directly into LlmChatView(provider: provider).
Currently, any package or application depending on flutter_ai_toolkit encounters two architectural limitations:
- WASM Incompatibility:
flutter_ai_toolkitcannot be compiled withdart2wasm(flutter build web --wasm), which also prevents downstream packages on pub.dev from earning the WebAssembly (WASM) compatibility badge and full pub points. This is caused by transitive dependencies (such asuniversal_platform,firebase_ai, or legacy web packages) that still referencedart:html/dart:js. - Monolithic Barrel File: The core contracts (
LlmProvider,ChatMessage,Attachment) are only exported through the top-levelpackage:flutter_ai_toolkit/flutter_ai_toolkit.dartbarrel. Because there is no separated platform interface or lightweight contract export, any provider implementation is forced to pull in the entire UI widget tree, Firebase dependencies, and hardware plugins (camera, waveform recorder).
Proposed Solutions
We would love to see one (or both) of the following improvements:
-
Migrate web dependencies to modern standards:
- Update transitive web imports and conditional exports to
dart:js_interopandpackage:web. - Ensure all dependencies support
dart compile wasm/flutter build web --wasm.
- Update transitive web imports and conditional exports to
-
Split or decouple the core interfaces (Modular Architecture):
- Separate the core data models and abstract interfaces (
LlmProvider,ChatMessage,Attachment, etc.) into a lightweight package (e.g.,flutter_ai_toolkit_platform_interface) or an isolated library export that has zero dependencies on Firebase or platform plugins. - This allows custom providers and routers to implement
LlmProviderwithout importing UI widgets, Firebase, or mobile-specific hardware plugins.
- Separate the core data models and abstract interfaces (
Environment & Context
- Flutter version:
>=3.27.0 - Dart SDK:
^3.7.0 - Target: WebAssembly (
flutter build web --wasm) and cross-platform provider integration
- Lenguaje dominante
- Dart
- Estrellas
- 292
- Forks
- 93
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de flutter/ai
-
Update AI Toolkit to record 7Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
LlmChatView dispose() does not cancel pending streaming response, causing setState on disposed widgetPosiblemente ocupada @apravint la tomó hace 101 días. Abiertowaiting for customer response
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
-
Loan appAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
-
IDX -> AntigravitiyQuizá libre de nuevo @rodydavis la tomó hace 141 días y no hay ningún pull request abierto. Abierto
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de flutter/ai
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Not all highlighting kinds have examples in DartColorsAndFontsPagePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertogood-first-issue P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
flutter/dart-intellij-third-party#758 ·
Los mantenedores suelen responder en 1 día
-
Bug: Incorrect location coordinates on logged Sound Meter dataPosiblemente ocupada @Jashan32 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area/archive bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
DarkFlippers/qUnleashed#374 ·
Los mantenedores suelen responder en 1 día