StacDialogAction class is used to display a dialog in Stac applications.
Properties
| Property | Type | Description |
|---|---|---|
| widget | Map<String, dynamic> | The widget to display inside the dialog. |
| request | StacNetworkRequest | The network request to perform before displaying the dialog. |
| assetPath | String | The asset path of the widget to display inside the dialog. |
| barrierDismissible | bool | Whether the dialog is dismissible by tapping outside. Defaults to true. |
| barrierColor | StacColor | The color of the modal barrier. |
| barrierLabel | String | The semantic label for the modal barrier. |
| useSafeArea | bool | Whether to use the safe area. Defaults to true. |
| traversalEdgeBehavior | StacTraversalEdgeBehavior | The traversal edge behavior of the dialog. |
Examples
Dialog with a Widget
StacDialogAction(
widget: StacText(data: 'Hello, World!'),
)
{
"actionType": "showDialog",
"widget": {
"type": "text",
"data": "Hello, World!"
}
}
Dialog with a Request
StacDialogAction(
request: StacNetworkRequest(
url: 'https://example.com/api',
method: Method.get,
),
)
{
"actionType": "showDialog",
"request": {
"url": "https://example.com/api",
"method": "get"
}
}
Dialog with an Asset
StacDialogAction(
assetPath: 'assets/dialog.json',
)
{
"actionType": "showDialog",
"assetPath": "assets/dialog.json"
}