StacSetValue class
A Stac widget that sets values in the application state.
This widget allows you to set multiple key-value pairs in the application's state and optionally render a child widget. It's useful for managing application state through JSON configuration.
StacSetValue(
values: [
{"key": "userName", "value": "John Doe"},
{"key": "isLoggedIn", "value": true},
],
child: StacText(data: 'Welcome!'),
)
{
"type": "setValue",
"values": [
{"key": "userName", "value": "John Doe"},
{"key": "isLoggedIn", "value": true}
],
"child": {"type": "text", "data": "Welcome!"}
}
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacSetValue
- Annotations
-
- @JsonSerializable()
Constructors
-
StacSetValue.new({List<
Map< values = const [], StacWidget? child})String, dynamic> > -
Creates a StacSetValue widget.
const
-
StacSetValue.fromJson(Map<
String, dynamic> json) -
Creates a StacSetValue from a JSON map.
factory
Properties
- child → StacWidget?
-
The child widget to render after the values are set.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
Widget type identifier.
no setteroverride
-
values
→ List<
Map< String, dynamic> > -
List of key-value pairs to set in the application state.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this widget to JSON.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited