Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Feature Request]: WASM compatibility & modularizing core LlmProvider interfaces

Abierto
#202 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
dart, flutter
Área
backend, web-dev

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:

  1. WASM Incompatibility: flutter_ai_toolkit cannot be compiled with dart2wasm (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 as universal_platform, firebase_ai, or legacy web packages) that still reference dart:html/dart:js.
  2. Monolithic Barrel File: The core contracts (LlmProvider, ChatMessage, Attachment) are only exported through the top-level package:flutter_ai_toolkit/flutter_ai_toolkit.dart barrel. 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:

  1. Migrate web dependencies to modern standards:

    • Update transitive web imports and conditional exports to dart:js_interop and package:web.
    • Ensure all dependencies support dart compile wasm / flutter build web --wasm.
  2. 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 LlmProvider without importing UI widgets, Firebase, or mobile-specific hardware plugins.
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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de flutter/ai

Todos los issues de flutter/ai

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.