Skip to content
pubscout

a2ui_core

0.8.0, released 3 days ago by labs.flutter.dev

Framework-agnostic Dart SDK for the A2UI protocol supporting messages, data binding, and state models.

WASM-ready
$ flutter pub add a2ui_core
Source repository

What it does

Provides protocol message parsing and validation, reactive state management using preact_signals, basic catalogs with validation and formatting functions, reactive component tree resolution, and bidirectional RPC coordination.

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

Use it when

  • You are building Dart or Flutter clients that render the A2UI protocol.
  • You need reactive state management and data binding for A2UI components.
  • You require message parsing and validation for A2UI v0.9, v0.9.1, and v1.0 envelopes.

Skip it when

  • You are not using the A2UI protocol in your application.
  • You need legacy A2UI v0.8 payload runtime processing.

Strengths

  • Supports multiple versions of the A2UI protocol (v0.9, v0.9.1, v1.0).
  • Built-in reactive state management with preact_signals.
  • Comprehensive JSON Schema validation and bidirectional RPC handling.

Weaknesses

  • Strictly tied to the A2UI protocol specification.
  • Legacy v0.8 payloads are not supported.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6
import 'package:a2ui_core/a2ui_core.dart';

void main() {
  final catalog = BasicCatalog.v1_0();
  final processor = MessageProcessor(
    catalogs: [catalog],
    defaultVersion: A2uiProtocolVersion.v1_0,
    outboundListener: (RendererToAgentMessage message) {
      print('Outbound: ${message.toJson()}');
    },
    unifiedOutbound: true,
  );

  final Subscription sub = processor.model.onSurfaceCreated.subscribe((surface) {
    print('Created surface: ${surface.id}');
  });

  processor.processMessages([
    {
      'version': '1.0',
      'createSurface': {
        'surfaceId': 'main',
        'catalogId': BasicCatalog.v1_0Id,
      },
    },
  ]);

  sub.unsubscribe();
  processor.dispose();
}

Works with

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