Flutter’s GenUI Package Overhauled: New Architecture Decouples Agent Interaction

By ✦ min read

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

Flutter’s GenUI Package Overhauled: New Architecture Decouples Agent Interaction

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

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

  1. Remove old provider-specific packages (e.g., genui_dartantic).
  2. Replace ContentGenerator with direct agent setup using A2uiTransportAdapter.
  3. Manage conversation state via the new Conversation facade.

Additional resources include updated documentation on flutter.dev/genui and the A2UI protocol spec at a2ui.dev.

Tags:

Recommended

Discover More

6 Key Takeaways from Remedy's Latest Business Update on Control, FBC Firebreak, and Resonant10 Reasons Why This $444 Off AMD Gaming PC Combo Is an Absolute StealFamily Reunion: A Chaotic Time-Attack Adventure Through a Child's Eyes at the Dinner TablePython's Declarative Charts Revolution: Episode #294 of The Real Python Podcast Dives into Data Visualization and IteratorsHow to Make Sense of Apple's Mac Mini Storage and Price Shifts: A Buyer's Guide