flutter_adaptive_cards_fs library
Render Adaptive Cards in Flutter host apps.
Use AdaptiveCardsCanvas to load card JSON, apply HostConfigs, and wire
host callbacks; use RawAdaptiveCard when you already have a parsed card
map.
Classes
- AdaptiveActionUpdate
-
Action overlay patch for
Action.*nodes. - AdaptiveCardContentProvider
- Async source of root card JSON for AdaptiveCardsCanvas.
- AdaptiveCardsCanvas
- Host entry widget: loads card JSON, applies HostConfigs, and renders RawAdaptiveCard.
- AdaptiveElementUpdate
- One element's runtime overlay patch (baseline JSON unchanged).
- AdaptiveFetchPolicy
- Limits applied to card-initiated HTTP GETs.
- AdaptiveUriAllowed
- The validated URL passed every policy check.
- AdaptiveUriDenied
- The URL was rejected by policy.
- AdaptiveUriPolicy
- Validates card-controlled URLs before they are launched or fetched.
- AdaptiveUriValidationResult
-
Outcome of
AdaptiveUriPolicy.validate. - AssetAdaptiveCardContentProvider
- Card source that reads JSON from the Flutter asset bundle.
- AuthCardButton
- A single button inside an AuthenticationConfig.buttons list.
- AuthenticationConfig
-
Root-level
authenticationobject on an Adaptive Card (v1.4+). - CardOverlayExtensionRegistry
- Registry of ElementOverlayExtension instances for one card scope.
- CardTypeRegistry
- Entry point for registering adaptive cards
- Choice
- Choice model for AdaptiveCards Input.ChoiceSet element
- DataQuery
-
Parsed
Data.Queryobject fromchoices.dataonInput.ChoiceSet. - ElementOverlayExtension
- Optional-package hook for merging extension-specific overlay fields.
- ExecuteActionInvoke
-
Payload delivered to the host
onExecutecallback. - Fact
- Fact model for AdaptiveCards FactSet element
- HostConfig
- Parsed Adaptive Cards HostConfig JSON that maps spec tokens to Flutter styling.
- HostConfigs
- Light and dark HostConfig pair with a mutable current selection.
- HttpActionHeader
- A single HTTP header carried by an HttpActionInvoke.
- HttpActionInvoke
-
Payload delivered to the host
onHttpcallback forAction.Http. - InheritedAdaptiveCardHandlers
- Host callback bundle for action and input events.
- InheritedAdaptiveCardSecurityPolicy
- Supplies the active AdaptiveUriPolicy and AdaptiveFetchPolicy to the adaptive-card widget subtree.
- InputChangeInvoke
-
Payload delivered to the host
onChangecallback when an input value changes. - JsonAdaptiveCardContentProvider
- Card source that decodes a JSON string at load time.
- MediaSource
- MediaSource model for AdaptiveCards Media element
- MemoryAdaptiveCardContentProvider
- Synchronous in-memory card source when JSON is already parsed.
- NetworkAdaptiveCardContentProvider
- Card source that fetches JSON over HTTP(S).
- OpenUrlActionInvoke
-
Payload delivered to the host
onOpenUrlcallback. - OpenUrlDialogActionInvoke
-
Payload delivered to the host
onOpenUrlDialogcallback. - OverlayCapabilityRegistry
-
Maps JSON element/action
typestrings to supported overlay fields. - RawAdaptiveCard
- Low-level card renderer when you already have parsed JSON.
- RawAdaptiveCardState
- Host-facing card state: runtime overlays, validation, and imperative updates without mutating baseline JSON.
- RefreshActionInvoke
-
Payload delivered to the host
onRefreshcallback. - RefreshConfig
-
Root-level
refreshobject on an Adaptive Card (v1.4+). - SigninActionInvoke
-
Payload delivered to the host
onSignincallback for a cardauthenticationsign-in button. - SubmitActionInvoke
-
Payload delivered to the host
onSubmitcallback. - TextRunModel
-
Parsed
TextRuninline from aRichTextBlockinlinesarray.
Enums
- ActionOverlayField
-
Runtime overlay patch field on an action (
AdaptiveActionUpdate/ host map). - AdaptiveCardBrightnessMode
- How RawAdaptiveCard selects between HostConfigs.light and HostConfigs.dark.
- ElementOverlayField
-
Runtime overlay patch field on an element (
AdaptiveElementUpdate/ host map).
Functions
-
actionIdFromMap(
Map< String, dynamic> actionMap) → String? -
Reads author-defined action
idfrom card JSON, or null when absent or auto-injected at card load. -
choicesFromJsonList(
Object? raw) → List< Choice> -
Parses a card JSON
choicesarray into Choice list; returns empty when invalid. -
choicesToJsonList(
List< Choice> choices) → List<Map< String, dynamic> > - Serializes choices for runtime overlay / resolved JSON boundaries.
-
factsFromJsonList(
Object? raw) → List< Fact> -
Parses a card JSON
factsarray; returns empty when invalid. -
factsToJsonList(
List< Fact> facts) → List<Map< String, dynamic> > - Serializes facts for overlay merge boundaries.
-
fieldsSetInActionUpdate(
AdaptiveActionUpdate update) → Set< ActionOverlayField> -
Returns overlay fields explicitly set on
update. -
fieldsSetInElementUpdate(
AdaptiveElementUpdate update) → Set< ElementOverlayField> -
Returns overlay fields explicitly set on
update. -
inlinesFromJsonList(
Object? raw) → List< Map< String, dynamic> > -
Parses a card JSON
inlinesarray; returns empty when invalid. -
inlinesToJsonList(
List< Map< inlines) → List<String, dynamic> >Map< String, dynamic> > - Serializes inlines for overlay merge boundaries.
-
mediaSourcesFromJsonList(
Object? raw) → List< MediaSource> -
Parses Media
sourcesarray from card JSON. -
readBodyWithLimit(
List< int> body, int maxBytes) → List<int> -
Returns
bodyunchanged when withinmaxBytes, otherwise throws AdaptiveFetchTooLargeException.
Typedefs
-
ElementCreator
= Widget Function(Map<
String, dynamic> map) -
Custom element builder registered under an Adaptive Cards
typestring.
Exceptions / Errors
- AdaptiveFetchTooLargeException
- Thrown when a remote response body exceeds AdaptiveFetchPolicy.maxBytes.
- AdaptiveUriPolicyException
-
Thrown by fetch paths (e.g. remote card loaders) when a URL fails
AdaptiveUriPolicyvalidation and there is no UI affordance to report the denial inline.