StacSetValueAction class

A Stac action that sets or updates values in state.

Accepts a list of key-value maps in values to be written to the application's state. Optionally, an action can be executed after the values are set.

{@tool snippet} Dart Example:

const StacSetValueAction(
  values: [
    {"key": "isLoggedIn", "value": true},
    {"key": "token", "value": "abc123"},
  ],
  action: {"type": "navigate", "routeName": "/home"},
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "setValue",
  "values": [
    {"key": "isLoggedIn", "value": true},
    {"key": "token", "value": "abc123"}
  ],
  "action": {"type": "navigate", "routeName": "/home"}
}

{@end-tool}

Inheritance
Available extensions
Annotations
  • @JsonSerializable.new()

Constructors

StacSetValueAction({List<Map<String, dynamic>>? values, StacAction? action})
Creates a StacSetValueAction that writes values and optionally runs action.
const
StacSetValueAction.fromJson(Map<String, dynamic> json)
Creates a StacSetValueAction from a JSON map.
factory

Properties

action → StacAction?
An optional action to execute after the values are written.
final
actionType → String
Action type identifier.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
jsonData → Map<String, dynamic>?
The raw JSON data associated with this action.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
values → List<Map<String, dynamic>>?
A list of maps representing key-value pairs to write to state.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(BuildContext context) → FutureOr

Available on StacAction?, provided by the StacActionParserExtension extension

toJson() → Map<String, dynamic>
Converts this StacSetValueAction instance to a JSON map.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited