DynamicWidgetContainer class
Main container that renders a list of widgets from agent JSON response.
Developer places this widget in the app and optionally passes the host app's ColorScheme so that dynamic widgets blend with the host design.
DynamicWidgetContainer(
responseJson: agentResponse,
colorScheme: Theme.of(context).colorScheme,
padding: EdgeInsets.all(12),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- DynamicWidgetContainer
Constructors
-
DynamicWidgetContainer({Key? key, Map<
String, dynamic> ? responseJson, List<WidgetEntry> ? entries, ColorScheme? colorScheme, OnWidgetDismiss? onDismiss, OnWidgetAction? onAction, double spacing = 8, EdgeInsetsGeometry padding = const EdgeInsets.all(16), bool scrollable = true}) -
const
Properties
- colorScheme → ColorScheme?
-
Host app's color scheme. When provided, widgets render using these
colors instead of the default theme. This is the primary way for
developers to make dynamic widgets match their app's look and feel.
final
-
entries
→ List<
WidgetEntry> ? -
Pre-parsed widget entries (alternative to responseJson).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onAction → OnWidgetAction?
-
Called when a widget action is triggered.
final
- onDismiss → OnWidgetDismiss?
-
Called when a widget is dismissed.
final
- padding → EdgeInsetsGeometry
-
Padding around the widget list.
final
-
responseJson
→ Map<
String, dynamic> ? -
Agent response JSON containing widgets array.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollable → bool
-
Whether to use a scrollable list.
final
- spacing → double
-
Spacing between widgets.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited