genui_catalog 0.5.0
genui_catalog: ^0.5.0 copied to clipboard
Ready-to-use GenUI CatalogItems for building dynamic AI-generated UIs.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.5.0 - 2026-09-25 #
Fixes found while building Lébénam Triage, a GenUI app that composes 16 of these components. Every new property is optional: existing apps and prompts keep working unchanged.
Added #
- CheckboxGroup / SwitchGroup:
submitLabel. When set, checking or flipping stays local and a button dispatches the selection once (<event>:<comma-separated values>). Without it, every change still dispatches immediately. With an LLM behind the events, this turns one model call per toggle into one per answer. - Translatable labels for text that was hard-coded in English:
ActionForm.requiredErrorText({label}placeholder),StepperCard.previousLabel/nextLabel,RatingInput.noRatingLabel/outOfLabel(screen readers). - StepperCard: tapping a step indicator shows that step. Local only: no event is dispatched.
Fixed #
- RatingInput now sends the rating:
rating_submittedcarries{rating, maxStars}in its event context. It used to send the event name only, so the agent never knew the score. - DataTable: the table fills the width of its card (it hugged its columns) and still scrolls horizontally when the columns need more room.
- README: the StepperCard example used
initialStep; the schema property iscurrentStep.
0.4.1 - 2026-09-25 #
Fixed #
- README — the "Getting started" and "Listening to events" snippets now compile with
genui 0.10:
PromptBuilder.chattakessystemPromptFragments(notinstructions), and events are read fromSurfaceController.onSubmit(there is nocontroller.on<UserActionEvent>). Added how to render aSurfaceand how to plug an LLM throughA2uiTransportAdapter. - README —
DataCatalogalso listsColumn/Row; the example section mentions all 17 components (was 12). CatalogEventsdartdoc — points toSurfaceController.onSubmit.
0.4.0 - 2026-09-25 #
Changed #
- Requires
genui^0.10.3(was^0.8.0). genui 0.10 moved its A2UI protocol layer ontopackage:a2ui_core; the catalog-widget authoring API is unchanged, so everyCatalogItemin this package works without modification. - Requires
json_schema_builder^0.1.7(was^0.1.3). genui 0.10 relies onSchemaRegistry, which older resolved versions did not provide, causing compile errors in apps with an existing lockfile.
Fixed #
- Example
AiServiceno longer forwardstransport.incomingMessagestoSurfaceController.handleMessagea second time (Conversationalready does it). Since genui 0.10 a duplicatecreateSurfacefor an active surface is an error.
0.3.0 - 2026-05-17 #
Changed #
ActionFormWidget.dispatchEvent— signature changed fromvoid Function(String)tovoid Function(String, Map<String, String>)so form field values are forwarded alongside the event name on submit.
0.2.1 - 2026-04-03 #
Changed #
AiServiceJSON parsing — replaced the multi-strategy extraction pipeline (5 fallback strategies, 7 helper methods) with a single_extractJsonObjectsFromContentcall using brace-counting. Validation now also checks forcreateSurfaceorupdateComponentskeys so non-A2UI JSON objects are silently skipped without extra repair attempts.AiServicetruncation repair — added trailing-brace repair inside_extractJsonObjectsFromContentso LLM-truncated JSON (unclosed}) is recovered gracefully before being dispatched to the transport.
Fixed #
CHANGELOG.mdformatting — corrected list marker from+to-in theRatingInputWidgethalf-star detection entry.
0.2.0 - 2026-04-03 #
Added #
ListCard(DataCatalog) — a card containing a list of tappable rows with optional icon, subtitle, trailing text, dividers, and destructive flag (rederror color).EmptyState(DataCatalog) — a centered empty-state view with title, description, icon, and an optional call-to-action button that dispatches a configurable event.SelectInput(FormCatalog) — a labelled dropdown for single-value selection; dispatches<event>:<value>on change.CheckboxGroup(FormCatalog) — a labeled multi-select checkbox list; dispatches<event>:<csv_values>on every change.SwitchGroup(FormCatalog) — a labeled list of on/off toggles with optional subtitles; dispatches<event>:<value>:<on|off>per toggle.CatalogEventsadditions —listItemTapped,emptyStateAction,optionSelected,selectionChanged,switchChangedconstants.- 30 new widget tests across 5 focused files for all new components.
0.1.0 - 2026-04-03 #
Added #
CatalogEvents— typed constants for all widget-dispatched event names (formSubmit,ratingSubmitted,searchQuery,stepNext,stepPrev).GenUICatalog.itemNames— dynamic list of all registered component names.GenUICatalog.findItem(String name)— null-safe lookup of aCatalogItemby name.- System prompt auto-generation — each sub-catalog now generates its
systemPromptFragmentsfrom the live item list; adding a component updates the prompt automatically. - Truncation indicators —
DataTableWidgetshows "Showing X of Y rows" when the 100-row limit is exceeded;ChartCardWidgetshows "Showing X of Y datasets" when the 6-dataset limit is exceeded. totalRowCount/totalDatasetCountoptional parameters onDataTableWidgetandChartCardWidgetto drive the truncation indicator.- Accessibility (
Semantics) — all 12 widgets now carry meaningful screen-reader labels: KpiCard (metric + trend), StatusBadge (status text), RatingInput (slider with increment/decrement), StepperCard (step X of N), TimelineCard (per-event label), DataTable (table region), StatRow (value + label per card), ProfileCard (name + role + details), MediaCard (title + content + tags). parseHexColorfallbackparameter — callers can now pass a theme-aware color (e.g.Theme.of(context).colorScheme.primary) instead of falling back to the hardcodedColors.blue.itemNamesgetter on each sub-catalog (DataCatalog,WorkflowCatalog,FormCatalog,MediaCatalog).- 76 widget and utility tests split across 15 focused files under
test/utils/,test/widgets/, andtest/items/, with shared helpers intest/helpers.dart.
Changed #
- Dark/light mode — replaced all hardcoded
Colors.grey[X]andColors.whiteusages withColorSchemesemantic tokens (onSurfaceVariant,outlineVariant,onPrimary,surfaceContainerHighest,primaryContainer,onPrimaryContainer). icon_utils.dart— expanded from ~25 to 200+ icon mappings across categories: trends, people, finance, commerce, analytics, communication, navigation, status, actions, files, location, time, tech, settings, health, and more. Unknown names now fall back toIcons.label_outlineinstead ofIcons.circle.ChartCardWidget._defaultColorsis nowstatic const— allocated once instead of on every build.StatRowWidget._limitis now a named constant; the.take(4)truncation moved from the item into the widget and produces a debugassertwith an explanatory message.RatingInputWidgethalf-star detection — rewrote using per-starSizedBoxStackwith two transparentGestureDetectorhalves, replacing the brokenfindRenderObject()approximation.
RatingInputWidgetkeyboard/accessibility — addedSemantics(slider: true)withonIncrease/onDecreasecallbacks so assistive technologies can increment and decrement the rating.- Sub-catalog system prompts now include constraint details (row limits, dataset limits, accepted enum values) and are generated from live metadata rather than hardcoded strings.
pubspec.yamlversion corrected from0.0.1to0.1.0.
Fixed #
RatingInputWidget: half-star gesture used the parent widget'sRenderBoxinstead of the individual star's, causing incorrect star selection.color_utils.dart: fallback was alwaysColors.blueregardless of the app theme; callers can now provide a context-appropriate fallback.
0.0.1 - 2026-04-02 #
Added #
- Initial release of
genui_catalog:DataCatalog: KpiCard, DataTable, ChartCard, StatRow, Column, RowWorkflowCatalog: TimelineCard, StatusBadge, StepperCardFormCatalog: ActionForm, SearchBar, RatingInputMediaCatalog: ProfileCard, MediaCard
- Utilities:
parseHexColor(),parseIconName() - Root helper:
GenUICatalog.alland sub-catalogasCatalog()methods CatalogItemContextAPI compatibility withgenui ^0.8.0- Initial unit tests for
StatusBadgeandActionForm