Flutter’s GenUI Package Overhauled: New Architecture Decouples Agent Interaction
Breaking: Flutter GenUI and A2UI Protocol Receive Major Update
The Flutter team has released a significant update to both the genui package and the A2UI protocol, moving from a structured output approach to a prompt-first design. This overhaul, driven by adoption of A2UI v0.9, fundamentally changes how developers build generative user interfaces (GenUI).
Developers now have direct control over LLM interactions, chat history, and error handling, as the framework removes the previously required ContentGenerator class. The update introduces a decoupled architecture with separate layers for engine, transport, and facade.
“This change gives developers unprecedented flexibility,” said a Flutter team spokesperson. “Instead of being locked into a rigid pipeline, they can now choose their own LLM provider, tweak parameters, and implement custom logic without framework interference.”
What Changed
- Shift from Structured Output First to Prompt First. Agents now include JSON blocks as text in responses rather than through structured output APIs.
- Removal of the
ContentGeneratorclass. Provider-specific packages likegenui_google_generative_aiandgenui_firebase_aiare no longer needed. - Introduction of three distinct layers: Engine (SurfaceController) for UI state/rendering, Transport (A2uiTransportAdapter) for message streaming, and Facade (Conversation) for high-level chat management.
The update marks a move from a “wrapped agent” model to a fully customizable integration. Developers must now manually set up connections to agents and pass messages via the TransportAdapter.
Background: GenUI and A2UI Explain
Generative UI (GenUI) is a pattern where an AI agent not only creates content but also decides how to display and make it interactive. Flutter’s genui package relies on A2UI, an open protocol enabling collaboration between agents and client renderers.
Previously, the genui package used a ‘Structured Output First’ philosophy, streaming A2UI messages through structured output APIs. The latest update flips this to ‘Prompt First’, with agents generating JSON as plain text in responses. This aligns with common LLM usage patterns and reduces dependency on specific API features.
What This Means for Developers
The decoupling simplifies migration but requires rewriting code that depended on ContentGenerator. Instead of passing a generator to SurfaceController, apps now handle agent connections directly.
“This is the most significant code change in the migration,” noted a Flutter contributor. “But it opens the door to more robust error handling, custom retry logic, and seamless integration with any LLM provider.”
For those migrating from v0.7.0 to v0.9.0, the team provides a detailed migration guide covering dependency cleanup and chat loop wiring. The update is expected to accelerate adoption of GenUI in Flutter apps by offering greater flexibility and performance.
Migration Steps
- Remove old provider-specific packages (e.g.,
genui_dartantic). - Replace
ContentGeneratorwith direct agent setup usingA2uiTransportAdapter. - Manage conversation state via the new
Conversationfacade.
Additional resources include updated documentation on flutter.dev/genui and the A2UI protocol spec at a2ui.dev.
Related Articles
- Chinese Hygon C86-4G Processors Gain GCC 17 Compiler Support
- Python Insider Blog Moves to a Git-Based Platform: Easier Contributions and Full Transparency
- 5 Must-Know Governance Features for .NET AI Agents with MCP Tool Calls
- Go 1.26 Ships with Major Language Tweaks and Green Tea GC Now Default
- The Unseen Dependencies: How TCMalloc Challenged Kernel's API Stability
- 6 Key Insights About Stack Allocation in Go for Faster Programs
- Mastering Stack Allocation in Go: Boosting Performance by Reducing Heap Pressure
- How to Reduce Heap Allocations by Stack-Allocating Slices in Go