genui_catalog 0.2.2
genui_catalog: ^0.2.2 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.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