Skip to content
pubscout

genui

0.10.4, released 8 weeks ago by labs.flutter.dev

Generates and displays dynamic user interfaces in Flutter using AI.

$ flutter pub add genui
Source repository

What it does

GenUI allows you to build dynamic, conversational user interfaces where the UI is constructed by an AI in real-time based on conversations with the user. It provides a Conversation facade, customizable widget catalogs, reactive data models, and transport adapters to handle incoming A2UI message streams.

AI-written summary of version 0.10.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to build applications where the UI is generated dynamically by an LLM or AI agent.
  • You need a conversational UI that can update components and data models on the fly.

Skip it when

  • Your application requires a completely static, pre-defined user interface.
  • You are not using an AI model or backend to generate dynamic UI definitions.

Strengths

  • Enables real-time, context-aware, and interactive generative user interfaces.
  • Flexible backend-agnostic design with custom widget catalogs and reactive data binding.

Weaknesses

  • Relies heavily on external LLM response reliability and structured streaming.
  • Requires custom bridge implementation for your specific AI agent provider.

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
14

Requires adding network client entitlements for iOS or macOS if making outbound network requests, and implementing an AI transport adapter.

class _MyHomePageState extends State<MyHomePage> {
  late final SurfaceController _controller;
  late final A2uiTransportAdapter _transport;
  late final Conversation _conversation;

  @override
  void initState() {
    super.initState();
    _controller = SurfaceController(catalogs: [CoreCatalogItems.asCatalog()]);
    _transport = A2uiTransportAdapter(onSend: _onSendToLLM);
    _conversation = Conversation(controller: _controller, transport: _transport);
  }

  Future<void> _onSendToLLM(ChatMessage message) async {
    final responseStream = myLlmClient.streamGenerateContent(message);
    await for (final chunk in responseStream) {
      _transport.addChunk(chunk);
    }
  }
}

Works with

Packages commonly used together with genui: ones it builds on, ones built on it, and its own family.