StacAction class
Base class for all Stac actions that can be performed on widgets.
Actions represent user interactions or system events that can be triggered
on Stac widgets. Each action type extends this base class and provides
specific functionality through the actionType
getter.
Example usage:
// Create a custom action
class CustomAction extends StacAction {
const CustomAction({super.jsonData});
@override
String get actionType => 'custom';
}
// Parse from JSON
final action = StacAction.fromJson({'type': 'custom', 'data': 'value'});
JSON representation:
{
"type": "action_type",
"data": "action_specific_data"
}
- Implementers
- Annotations
-
- @JsonSerializable()
Constructors
-
StacAction.new({Map<
String, dynamic> ? jsonData}) -
Creates a new StacAction instance.
const
-
StacAction.fromJson(Map<
String, dynamic> json) -
Creates a StacAction instance from JSON data.
factory
Properties
- actionType → String
-
The type identifier for this action.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
jsonData
→ Map<
String, dynamic> ? -
The raw JSON data associated with this action.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this action to its JSON representation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited