flutter_adaptive_cards_fs 0.10.0
flutter_adaptive_cards_fs: ^0.10.0 copied to clipboard
Adaptive Cards are platform-agnostic snippets of UI, authored in JSON, that apps and services can openly exchange.
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.
[Unreleased] #
0.10.0 #
- Root card
refresh(v1.4+): parserefresh.action,userIds, andexpiresviaRefreshConfig; manual refresh affordance (top-right icon) whenrefresh.actionis set; one-shot auto-refresh after first frame whenexpiresis in the past;refresh.userIdsgates auto-refresh only (viaAdaptiveCardsCanvas.currentUserId/currentUserIdProvider). RefreshActionInvokeand optionalInheritedAdaptiveCardHandlers.onRefresh; falls back toonExecutewith merged inputdatawhenonRefreshis unset.- Public export of
RefreshConfigfromflutter_adaptive_cards_fs.dart. - Tests:
test/models/refresh_config_test.dart,test/refresh/refresh_action_test.dart. - Public exports for
RawAdaptiveCard,RawAdaptiveCardState, andDataQuery(host integration and backend invoke wiring). - Data.Query
associatedInputs: sibling input values merged intoDataQuery.parametersonInputChangeInvokewhenauto(default). - Action.Submit / Action.Execute
associatedInputs:"none"skips input merge into invokedata. Iconelement (v1.5 documentation hub):AdaptiveIconregistered for typeIcon; Fluent name catalog (~68 common names) viafluent_icon_map.dartwith Material icon fallbacks;size,color, andstyle(Filled/Regular) tokens; optionalselectActionviaAdaptiveTappable.- Chart color tokens:
chart_colors_config.dart— HostConfig palette + categorical, sequential, and diverging palettes plus Teams semantic tokens (categoricalBlue,sequential5,divergingRed,good, …). ReferenceResolver:resolveChartPalette({colorSet})selects named palettes;resolveChartColor()resolves semantic chart tokens before hex parsing.- Tests:
test/elements/icon_test.dart,test/hostconfig/chart_color_sets_test.dart,test/golden_icon_test.dart. RichTextBlock+TextRun(v1.2):AdaptiveRichTextBlockwith per-run styling (weight,color,italic,underline,highlight,fontType,size) andselectActionviaTapGestureRecognizer;TextRunModel.fromJson.TextBlock: plainTextpath honorsmaxLines,TextOverflow.ellipsis, and HostConfigcolor/isSubtlewhensupportMarkdownis false;AdaptiveCardsCanvas.supportMarkdownnow flows intoCardTypeRegistry.- Tests:
test/elements/rich_text_block_test.dart,test/elements/text_block_test.dart,test/golden_rich_text_block_test.dart. - Shared parse helpers:
parseIsVisible()andparseHostConfigColor()inutils.dart(HostConfig color parsing and visibility baseline parsing). - Public export of
InheritedAdaptiveCardHandlersfromflutter_adaptive_cards_fs.dart(for test support and host callback wiring withoutimplementation_imports). - Tests:
test/utils/parse_helpers_test.dart; merged staticisVisiblecases intotest/elements/is_visible_test.dart. flutter_adaptive_cards_fstest harness now re-exportsflutter_adaptive_cards_test_supportfromtest/utils/test_utils.dart; golden tests use sharedconfigureTestView,getGoldenPath, andgetV16SampleForGoldenTest.flutter_test_config.dartdelegates to sharedadaptiveCardsTestExecutable(HTTP overrides + Roboto font loading).- Removed unused
mockitodev dependency from this package. - Dead legacy sources:
adaptive_element.dart,basic_markdown.dart(superseded by registry /flutter_markdown). - Orphan test fixtures and placeholder test:
choice_set_radio.json,example15.json,test/elements/text_block_text.dart, duplicate roottest/is_visible_test.dart. AGENTS.mddocumentation links (doc/→docs/).- Public exports for
Choice,Fact, andMediaSourcefromflutter_adaptive_cards_fs.dart. - List parse helpers:
choicesFromJsonList/choicesToJsonList,factsFromJsonList,mediaSourcesFromJsonList. - Runtime
factsoverlay onFactSetelements (setFacts,clearFacts,applyUpdates/applyUpdatesFromMap). - Widgetbook FactSet → Facts overlay (knob) demo for interactive overlay testing.
- Shared
parseAdaptiveDateValue/formatAdaptiveDateValuehelpers forInput.Date(date_input_utils.dart). ChildStylerimplements container style and horizontal-alignment inheritance via nestedstyleReferenceResolverProvideroverrides.ReferenceResolver.resolveTextBlockStyle(),resolveImageIsPerson(), andresolveEffectiveHorizontalAlignment().AdaptiveCardBrightnessMode(auto/light/dark) onRawAdaptiveCardandAdaptiveCardsCanvas.- Style inheritance diagrams in
docs/adaptive-style.md. - Tests:
test/style/inheritance_test.dart. ElementOverlay.choicesnow storesList<Choice>internally; resolved element JSON still exposeschoicesas maps for widget compatibility.Input.ChoiceSetfiltered modal usesChoiceinstead of internalSearchModel.AdaptiveFactSetandAdaptiveMediaparse child lists via shared typed helpers.- Container background uses only each element's own
style; foreground palette usesinheritedContainerStylefrom ancestors. TextBlockapplies HostConfigTextStylesConfigforheading/columnHeader; table header rows usecolumnHeaderdefaults.Imagepersonclipping applies only whenstyleisperson(not other style names).- Theme brightness changes re-resolve styles via brightness-keyed root
ProviderScope. ThemeColorFallbacks: HostConfig color fallbacks derived fromThemeData.colorScheme(theme_color_fallbacks.dart); replaces hardcoded light-theme colors previously inFallbackConfigs.ReferenceResolver: requiredcolorFallbacksparameter;resolveProgressColor(); foreground, container, chart, separator, and badge resolution uses theme-derived defaults when HostConfig omits values.RawAdaptiveCard: wiresThemeColorFallbacks(Theme.of(context))into the resolver on each build.- HostConfig JSON parsers (
FontColorConfig,ForegroundColorsConfig,ContainerStyleConfig,ContainerStylesConfig,HostConfig.fromJson): optionaltheme:/ThemeColorFallbacks.forParsingfor parse-time color defaults. - Documentation:
docs/hostconfig.md(replacesdocs/hostconfig_tests.md) — theme fallback pipeline, Widgetbook notes, and serialization test conventions. - Regenerated linux and macos golden baselines for theme-derived HostConfig color fallbacks.
Input.DateinitData/initInputseeding: controller no longer receives placeholder text; submit and overlay values useyyyy-MM-ddper spec. Hosts that relied on ISO-8601 inonChangecallbacks should expectyyyy-MM-ddinstead.Input.ChoiceSetloadInput: selection reconcile clears the value overlay (clearInputValue) instead of writing'', matching legacyloadInput/setChoicesbehavior.- Root card
refresh(v1.4+): parserefresh.action,userIds, andexpiresviaRefreshConfig; manual refresh affordance (top-right icon) whenrefresh.actionis set; one-shot auto-refresh after first frame whenexpiresis in the past;refresh.userIdsgates auto-refresh only (viaAdaptiveCardsCanvas.currentUserId/currentUserIdProvider). RefreshActionInvokeand optionalInheritedAdaptiveCardHandlers.onRefresh; falls back toonExecutewith merged inputdatawhenonRefreshis unset.- Public export of
RefreshConfigfromflutter_adaptive_cards_fs.dart. - Tests:
test/models/refresh_config_test.dart,test/refresh/refresh_action_test.dart. - Public exports for
RawAdaptiveCard,RawAdaptiveCardState, andDataQuery(host integration and backend invoke wiring). - Data.Query
associatedInputs: sibling input values merged intoDataQuery.parametersonInputChangeInvokewhenauto(default). - Action.Submit / Action.Execute
associatedInputs:"none"skips input merge into invokedata. Iconelement (v1.5 documentation hub):AdaptiveIconregistered for typeIcon; Fluent name catalog (~68 common names) viafluent_icon_map.dartwith Material icon fallbacks;size,color, andstyle(Filled/Regular) tokens; optionalselectActionviaAdaptiveTappable.- Chart color tokens:
chart_colors_config.dart— HostConfig palette + categorical, sequential, and diverging palettes plus Teams semantic tokens (categoricalBlue,sequential5,divergingRed,good, …). ReferenceResolver:resolveChartPalette({colorSet})selects named palettes;resolveChartColor()resolves semantic chart tokens before hex parsing.- Tests:
test/elements/icon_test.dart,test/hostconfig/chart_color_sets_test.dart,test/golden_icon_test.dart.
0.9.0 #
Added 0.9.0 #
- Filtered
Input.ChoiceSetmodal lists and typeahead search; choice titles drive search while submit,onChange, andData.Queryuse choice values. - Dependent
Input.ChoiceSetsupport viavalueChangedActionand host-drivenapplyUpdates/Data.Querycascade. OpenUrlActionInvoke,OpenUrlDialogActionInvoke, andInputChangeInvokepublic models exported fromflutter_adaptive_cards_fs.dart.- Tests:
test/actions/open_url_action_invoke_test.dart,test/actions/open_url_dialog_action_invoke_test.dart.
Changed 0.9.0 #
onSubmitnow receivesSubmitActionInvokeinstead of a bareMap. Useinvoke.actionIdandinvoke.data(merged actiondata+ input values).onExecutenow receivesExecuteActionInvokeinstead of a bareMap. Useinvoke.verb,invoke.actionId, andinvoke.data.GenericExecuteAction.tapno longer takes a separateverbargument; read action metadata fromadaptiveMapin custom implementations (or delegate toExecuteActionInvoke.fromActionMap).onOpenUrlnow receivesOpenUrlActionInvoke(url, optionalactionId) instead of a bareString.onOpenUrlDialognow receivesOpenUrlDialogActionInvoke(url, optionalactionId) instead of a bareString.onChangenow receivesInputChangeInvoke(inputId,value,dataQuery,cardState) instead of four separate parameters.AdaptiveCardsCanvas.onChangeandRawAdaptiveCard.onChangeuse the sameInputChangeInvoketype.- Fixed semantic binding error when dismissing the filtered ChoiceSet modal panel (clear control separated from
InputDecoration.suffix).
Removed #
- Unused
onSubmit,onExecute, andonOpenUrlfields onAdaptiveCardsCanvasState. UseInheritedAdaptiveCardHandlersfor Submit, Execute, and OpenUrl callbacks.
0.8.0 #
- Migrated all modifyable state to be reactive using riverpod via overlay on top of adaptive card json: ElementOverlay and ActionOverlay
- Elements value, error messages, error state, isVisble and many other attributes
- Actions isEnabled and other attributes
- Implemented regex validation in input field
- Added AI skills flutter and dart provided by flutter and dart teams.
- Added AI superpowers
Added 0.8.0 #
AdaptiveElementUpdate/AdaptiveActionUpdateand bulkapplyUpdates/applyUpdatesFromMapon the document notifier andRawAdaptiveCardState.ElementOverlay.isRequiredandElementOverlay.url;AdaptiveInputMixinlistens for resolvedisRequired;AdaptiveImagelistens for resolvedurl.- Tier 3 overlays:
label,placeholderon inputs;title,tooltipon actions; merged viaapplyUpdates/applyUpdatesFromMap;AdaptiveInputMixinandAdaptiveActionStateMixinupdate UI reactively. initDatasupports scalar values or per-id patch maps;seedInputValuesdelegates toapplyUpdates(single revision).- Default Submit / Execute required-field checks use resolved
isRequired(overlay ?? baseline). Input.Textregexvalidation (AC 1.3): pattern checked on field blur and on Submit / Execute via sharedtextInputValueIsValid; invalid values setisInvalidand showerrorMessage.- Tests:
test/riverpod/apply_updates_test.dart,test/inputs/cascade_choice_set_test.dart,test/inputs/is_required_overlay_test.dart,test/elements/image_url_overlay_test.dart,test/actions/submit_required_overlay_test.dart. - Tests:
test/inputs/input_text_validation_test.dart,test/inputs/input_text_regex_test.dart,test/golden_input_text_regex_test.dart(sampletest/samples/ac-qv-event.json). - Design spec:
docs/superpowers/specs/2026-06-03-dynamic-property-updates-design.md. resetInput(id)on the document notifier andRawAdaptiveCardState;AdaptiveInputMixin.resetInput()delegates to the notifier.- Factory reset clears input overlays including
label,placeholder, andisRequired(resolved → baseline JSON). Seedocs/reactive-riverpod.md. - Design spec:
docs/superpowers/specs/2026-06-03-overlay-reset-semantics-design.md. Action.ResetInputstargetInputIds: reset only listed input ids; omitted property resets all inputs; empty array resets nothing. Shared executor used by action button tap and inputvalueChangedAction.valueChangedActiononInput.*: when the user changes a field, runs embeddedAction.ResetInputs(e.g. dependent ChoiceSet / country–city). Discrete inputs fire immediately;Input.Text/Input.Numberfire on focus loss or editing complete, not each keystroke.- Document notifier
resetInputs(List<String> ids)— batch factory reset in one revision (same overlay rules asresetInput(id)). - Sample
test/samples/action_reset_inputs_targeted.json; tests for targeted reset andvalueChangedAction; WidgetbookActions.Reset (targeted)use case. - Design spec:
docs/superpowers/specs/2026-06-04-action-resetinputs-targetinputids-design.md.
Changed 0.8.0 #
-
Scoped dependency injection now uses nested
InheritedReferenceResolverwidgets instead of Riverpod:- Outer scope (from
RawAdaptiveCard):resolver(includescardTypeRegistry/actionTypeRegistry),rawAdaptiveCardState— read viaInheritedReferenceResolver.rawCardScopeOf(context). - Inner scope (from each
AdaptiveCardElement):adaptiveCardElementState— read viaInheritedReferenceResolver.elementScopeOf(context).
- Outer scope (from
-
ProviderScopeMixinunchanged by name; implementations now read the inherited scopes above (noref,ConsumerWidget, or app-levelProviderScoperequired). -
Host-facing callbacks remain on
InheritedAdaptiveCardHandlers. -
See
doc/replace-riverpod.mdfor the migration map from former provider names. -
Updated to Dart SDK 3.12 and Flutter 3.44
-
Regenerated golden test images for Flutter 3.44 rendering changes
-
Refactored
HostConfigclasses by extracting bundled classes (e.g. frommiscellaneous_configs.dartandfont_config.dart) into dedicated individual files underlib/src/hostconfig/to improve maintainability. -
Updated
AdaptiveColumn,AdaptiveContainer, and internal utilities to strictly useReferenceResolveras a facade for accessing HostConfig values (e.g.resolveSpacing()), removing direct dependencies on underlying config objects likeSpacingsConfig. -
Created
doc/Architecture-Overview.mdto document system architecture, package structure, internal state management, and extensibility points. -
Consolidated documentation around known gaps and priority issues into
doc/Implementation-Status.md. -
ReferenceResolverno longer carriescardTypeRegistryoractionTypeRegistry. It is a HostConfig/theme facade only. Element and action factories are provided via RiverpodcardTypeRegistryProviderandactionTypeRegistryProvider(seedoc/reactive-riverpod.md). -
Input.ChoiceSetreads effective choices fromresolvedElementProviderinstead of local-only state. -
RawAdaptiveCardState.loadInputandinitInputdelegate to the document notifier (no element-tree walk). -
initDataseeds input overlays viaseedInputValuespost-frame. -
resetAllInputs/resetInput(id)factory-reset input overlays to baseline (value, choices, validation,isRequired,label,placeholder); preserve inputisVisibleand typeahead session fields only. -
ElementOverlay.choices— runtime overlay forInput.ChoiceSetdynamic option lists; merged viaresolvedElementProvider. -
Document notifier APIs:
setChoices,appendChoices,seedInputValues,setDataQuerySession. -
DataQuery.count/DataQuery.skip— spec fields for typeahead pagination. -
ActionOverlayandactionOverlaysByIdonAdaptiveCardDocumentfor AC 1.5 actionisEnabled. -
resolvedActionProvider(id)— merged baseline + action overlay map forAction.*nodes. -
Document notifier:
setInputError,clearInputError,setActionEnabled,setActionsEnabled. -
ElementOverlay.errorMessageandElementOverlay.isInvalidmerged viaresolvedElementProvider. -
AdaptiveActionStateMixin— reactiveisEnabledforIconButtonActionandAction.ShowCard. -
Host helpers on
RawAdaptiveCardState:setInputError,clearInputError,setActionEnabled. -
ElementOverlay.text— runtime replacement ofTextBlock"text"; merged viaresolvedElementProvider. -
Document notifier:
setText,clearText;AdaptiveTextBlocklistens for resolvedtext. -
Host helpers:
RawAdaptiveCardState.setText/clearText. -
Tests:
test/elements/text_block_text_overlay_test.dart. -
Tests:
test/inputs/input_error_overlay_test.dart,test/actions/action_enabled_overlay_test.dart, sampletest/samples/v1.5/action_is_enabled.json. -
resetAllInputsclears validation overlays on inputs; preservesactionOverlaysById. -
setInputValueclears host validation overlays when the user edits an input.
0.7.0 #
- Added
selectActionsupport toTableCell(AdaptiveTable), wrapped viaAdaptiveTappableto enable action handlers when cells are tapped. - Added full
selectActionsupport and tap testing validation onAdaptiveCardElement,AdaptiveContainer,AdaptiveColumn, andAdaptiveImage(fixed tap hit-tests using base64 URI elements).. - change landscape / portrait breakpoint handling for AdaptiveCardElement
parseTextStringnow accepts an optionallocaleparameter for correct date/time localization.AdaptiveTextBlocknow passes the currentLocalizations.maybeLocaleOf(context)toparseTextStringfor region-aware date/time macro expansion.- Insured
AdaptiveElementMixinproperly unregisters widgets ondispose. - Fixed
minHeightparameter parsing and constraint application onAdaptiveColumnandAdaptiveContainerelements (supporting raw pixel and integer formats). - Fixed background image aspect-ratio sizing on
AdaptiveColumnandAdaptiveContainerelements when they only contain abackgroundImageand haveminHeightor pixelwidthconstraints set, ensuring the other dimension scales dynamically to preserve original image proportions. - Tests for
Data.QueryChoiceSet flows:loadInputrefresh after mount and fromonChange,setDataQuerySessionmerge into resolvedchoices.data, andinitDatawithchoices.data(choice_set_data_query_test.dart,init_data_overlay_test.dart,adaptive_card_document_notifier_test.dart).
0.6.0 #
- Bumped versions to 0.6.0 for next development cycle
- Updated to Dart SDK 3.11 and Flutter 3.41
- Removed
uuidpackage dependency and replaced it with Flutter's nativeUniqueKey()for widget key generation. - Removed unused
tinycolor2package dependency to reduce library footprint. - Renamed
AdaptiveCardsRoottoAdaptiveCardsCanvas - Inject
idattributes into the JSON tree in theAdaptiveCardsCanvasso that all objects have ids when not provided. Note that this changes the provided JSON. You can see this in the adaptive_explorer app in the merged tab. - Fixed
resetInputs()to correctly clear and revert underlying UI state (text controllers, selectors, etc.) across allInputelement types. - Fixed
Input.Timevalidation logic which previously rejected valid times. Improved the displayed error message format. - Fixed Cupertino Time Picker overlay dismissal to pop the modal itself instead of the root navigator.
0.5.0 #
- version numbers were sync'd to 0.5.0
- Added
ChartColorsConfigtoHostConfigto allow custom color palettes for charts. - Added
ReferenceResolverwithresolveChartPaletteandresolveChartColormethods. - migrated more hard coded styles to the resolver
- Abstracted
ProviderScopegetter functions into a newProviderScopeMixinaway fromAdaptiveElementMixin.
0.4.0 - 2026-04-14 #
- version numbers were sync'd to the flutter_adaptive_charts_fs 0.4.0
0.3.0 - 2026-04-12 #
- First version to be published on pub.dev out of the freemansoft repo
- Added the adaptive_explorer app
- Set versions on all projects to 0.3.0
- renamed package
flutter_adaptive_cardstoflutter_adaptive_cards_plusto avoid pub.dev name collision - add data query support
- Renamed AdaptiveCard to AdaptiveCardsRoot
- Input field widgets now use the input id as their
ValueKey(e.g.ValueKey('myInputId')) - Parent/adaptive card keys for inputs use the suffix
_adaptive(e.g.ValueKey('${id}_adaptive')) - Selector item keys use the format
${id}_${itemKey}(e.g.ValueKey('myChoiceSet_Choice 1')) RawAdaptiveCard.searchListnow accepts an optionalinputIdwhich is propagated to the choice-filter modal so the modal search field can be keyed and tested.- Tests and examples were updated to reflect the new keys (non-golden tests updated, new
text_input_test.dartadded). - Behavior change: Non-input adaptive widgets now use
generateAdaptiveWidgetKey()for their widget keys instead ofgenerateWidgetKey(). Update any tests or consumers that relied on the old keys. - Consumers should update any tests or code that relied on the old
<id>_inputkeys to the new naming scheme. - change name to
flutter_adaptive_cards_fsto avoid conflict on pub.dev with package published 12/2025 - Added dynamic dark mode support to
RawAdaptiveCardby listening toTheme.of(context).brightness. - Enabled
verticalContentAlignmentonAdaptiveContainer. - Fixed action
resolveOrientationto useActionsConfigvalues from HostConfig. - Added basic
"fallback": "drop"support for elements that fail to map or are unknown. - Added
resolveInputForegroundColortoReferenceResolverand updatedChoiceSetdropdown to use it for better theme-aware coloring. - Added
{{DATE(timestamp, FORMAT)}}and{{TIME(timestamp)}}macro replacements inTextBlockandFactSetelements using a newDateTimeUtilsutility. - Added
intldependency for robust date parsing and localization approximations. - Golden Image Reorganization: Restructured golden images into platform-specific subdirectories (
test/gold_files/linux/,test/gold_files/macos/, etc.). - Dynamic Golden Resolution: Added
getGoldenPathhelper intest_utils.dartto automatically select the appropriate golden directory based on the host platform.
0.2.1 - 2025-09-23 #
- Converted provider to riverpod 3 9/2025
- Updated libraries major-versions 9/2025
- Ipdated for flutter 3.24 9/2025
- Tested with ios 26 simulator and macos 26.0 9/2025
- Pointed at https microsoft images which causes CORS issue in web example app 9/2025
- Updated to the current Flutter
- Migrating all style into the Resolver so that all AdaptiveCard text styles are mapped there. Future create themeing for this
- Enabling workflow - or at least thinking about it
- Added Accordion, Badge, Carosel, CodeBlock, ProgressBar, ProgressRing, PieChart, BarChart
- Added
fvmfor flutter version management - currently 3.38.5 - BackgroundImage support for Container. Fixed support for fillMode
- Migrated to widgetbook 1.0.0 and deleted example app. This lost the lab and lab_web utilities
- Added hostconfig objects and integrated them and fallback hostconfig into the AdaptiveCard widgets.
- Addeed SVG support for images - but not background images
- Added Inline in-memory image support - png
- All elements have repeatable id values if not specified in the json (hashcode(adaptiveMap))
- Changed action path again (simplified)
- Put provider back in for raw and adaptive card element
- Added keys for the Adaptive cards
- Added calcuated and specified ids
- Added keys to the input fields in the input adaptive cards and atual input widgets for testing
- Migrated the hostconfig from InheritedReferenceResolver to riverpod provider_scope
- Selection applied via AdaptiveTappable to AdaptiveCard Element and Containers
- Add tooltips to actions
- Migrate from flutter_markdown to flutter_markdown_plus as
flutter_markdownis deprecated - Add template and data json merge support - Adaptive Cards 1.3
- Updated table support suing LLM