Skip to main content

Modal Bottom Sheet Action

The StacModalBottomSheetAction class is used to display a modal bottom sheet in Stac applications.

Properties​

PropertyTypeDescription
widgetMap<String, dynamic>?The widget to display inside the modal bottom sheet.
requestStacNetworkRequest?The network request to perform before displaying the modal bottom sheet.
assetPathString?The asset path of the widget to display inside the modal bottom sheet.
backgroundColorString?The background color of the modal bottom sheet.
barrierLabelString?The semantic label for the modal barrier.
elevationdouble?The elevation of the modal bottom sheet.
shapeStacBorder?The shape of the modal bottom sheet.
constraintsStacBoxConstraints?The constraints for the modal bottom sheet.
barrierColorString?The color of the modal barrier.
isScrollControlledboolWhether the modal bottom sheet is scroll controlled. Defaults to false.
useRootNavigatorboolWhether to use the root navigator. Defaults to false.
isDismissibleboolWhether the modal bottom sheet is dismissible. Defaults to true.
enableDragboolWhether the modal bottom sheet can be dragged. Defaults to true.
showDragHandlebool?Whether to show a drag handle on the modal bottom sheet.
useSafeAreaboolWhether to use the safe area. Defaults to false.

Example JSON​

{
"actionType": "showModalBottomSheet",
"widget": {
"type": "container",
"height": 200,
"color": "amber",
"child": {
"type": "center",
"child": {
"type": "column",
"mainAxisAlignment": "center",
"mainAxisSize": "min",
"children": [
{
"type": "text",
"data": "Modal BottomSheet"
},
{
"type": "elevatedButton",
"child": {
"type": "text",
"data": "Close BottomSheet"
},
"onPressed": {
"actionType": "pop"
}
}
]
}
}
}
}
{
"actionType": "showModalBottomSheet",
"assetPath": "assets/widgets/modal_bottom_sheet.json"
}
{
"actionType": "showModalBottomSheet",
"request": {
"url": "https://example.com/api",
"method": "get"
}
}