genui_button 0.0.1 copy "genui_button: ^0.0.1" to clipboard
genui_button: ^0.0.1 copied to clipboard

A GenUI compatible button widget package. Provides a GenUIButton catalog item for GenUI agents to produce interactive UI.

genui_button #

A GenUI compatible button widget package, giving AI agents the ability to generate styled buttons connected to your app's interactions.

Features #

  • Provides a GenUIButton widget specifically defined as a GenUI CatalogItem.
  • Supports elevated, filled, outlined, and text visual styles.
  • Integrates flawlessly with genui properties to accept label string and action ID payload.
  • Out of the box UserActionEvent triggering when tapping.

Getting started #

In your pubspec.yaml, add the dependency:

dependencies:
  flutter:
    sdk: flutter
  genui_button: ^0.0.1

Usage #

Simply register genUiButton with your GenUI A2uiMessageProcessor config:

import 'package:genui_button/genui_button.dart';
import 'package:genui/genui.dart';

final a2uiMessageProcessor = A2uiMessageProcessor(
  catalogs: [
    CoreCatalogItems.asCatalog().copyWith([genUiButton])
  ],
);

Then your FirebaseAiContentGenerator system instruction can tell the agent to use GenUIButton.

final contentGenerator = FirebaseAiContentGenerator(
  systemInstruction: 'Use GenUIButton to provide user actions.',
  additionalTools: a2uiMessageProcessor.getTools(),
);

Whenever the agent generates a UI containing a button, it can trigger UserActionEvent actions back to the app logic that you configure.

1
likes
0
points
177
downloads

Publisher

unverified uploader

Weekly Downloads

A GenUI compatible button widget package. Provides a GenUIButton catalog item for GenUI agents to produce interactive UI.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, genui, json_schema_builder

More

Packages that depend on genui_button