● LIVE   Breaking News & Analysis
Paintou
2026-05-20
Programming

Flutter's GenUI Overhaul: Agent-Driven UI Framework Shifts to 'Prompt First' Architecture

Flutter’s GenUI package and A2UI protocol undergo a major update, shifting from ‘Structured Output First’ to ‘Prompt First’ architecture. The ContentGenerator is removed, and the framework splits into Engine, Transport, and Facade layers, giving developers direct control over LLM interactions.

Breaking: Flutter's GenUI Package and A2UI Protocol Get Major Update

The Flutter team has released a significant update to its GenUI package and the underlying A2UI protocol, marking a dramatic shift in how developers build generative user interfaces. The update moves away from a “Structured Output First” approach to a “Prompt First” philosophy, where agents embed JSON blocks directly in their text responses.

Flutter's GenUI Overhaul: Agent-Driven UI Framework Shifts to 'Prompt First' Architecture

“This is a fundamental rethinking of the architecture,” said a Flutter team spokesperson. “Developers now have direct control over how their app interacts with large language models, rather than being funneled through a rigid generator pipeline.”

Architecture Decoupling: What Changed

The previous version of GenUI relied on a ContentGenerator class that wrapped all aspects of prompt construction, LLM calls, and response parsing. That class has been completely removed.

In its place, the framework is now split into three distinct layers:

  • Engine (SurfaceController) – Manages UI state and rendering.
  • Transport (A2uiTransportAdapter) – Handles message streaming between the agent and the renderer.
  • Facade (Conversation) – Provides a high-level API for chat state management.

This decoupling means developers can customize chat history, retry logic, and error handling. “You’re no longer forced to use a pre‑wrapped agent,” the spokesperson added. “You can choose any model, tweak generation settings, and add custom functions without going through the framework’s API.”

Impact on Existing Integrations

Because the ContentGenerator is gone, all provider‑specific wrapper packages – such as genui_dartantic, genui_google_generative_ai, and genui_firebase_ai – have been removed from the package tree.

“This is the most significant code change in the migration,” the Flutter team warned. Developers who previously passed a ContentGenerator to their SurfaceController must now set up their own agent connection and use a TransportAdapter to exchange messages.

Background

Generative UI (GenUI) is a user experience pattern where an agent not only generates content but also decides how to display and make that content interactive. Flutter’s implementation relies on A2UI, an open protocol that defines how agents and renderers collaborate on UI composition and state.

The genui package connected to an agent via A2UI, providing a catalog of widgets for the agent to use. The latest update aligns with version 0.9 of the A2UI protocol.

What This Means

For developers migrating from v0.7.0 to v0.9.0, the update requires careful dependency cleanup and wiring of new chat loops. The team has published a migration guide covering steps from removing old dependencies to integrating the new TransportAdapter.

“This gives developers far more flexibility,” said a Flutter community lead. “But it also means more responsibility for managing the agent connection and message flow.” The shift is expected to unlock more powerful, responsive UI patterns—especially for apps that rely on real‑time agent interactions.

Updated guidance and code examples are available in the official Flutter documentation.