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

Properties

PropertyTypeDescription
widgetStacWidgetThe widget to display inside the modal bottom sheet.
requestStacNetworkRequestThe network request to perform before displaying the modal bottom sheet.
assetPathStringThe asset path of the widget to display inside the modal bottom sheet.
backgroundColorStacColorThe background color of the modal bottom sheet.
barrierLabelStringThe semantic label for the modal barrier.
elevationdoubleThe elevation of the modal bottom sheet.
shapeStacBorderThe shape of the modal bottom sheet.
constraintsStacBoxConstraintsThe constraints for the modal bottom sheet.
barrierColorStacColorThe 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.
showDragHandleboolWhether to show a drag handle on the modal bottom sheet.
useSafeAreaboolWhether to use the safe area. Defaults to false.

Examples

StacModalBottomSheetAction(
  widget: StacContainer(
    height: 200,
    color: StacColors.amber,
    child: StacCenter(
      child: StacColumn(
        mainAxisAlignment: StacMainAxisAlignment.center,
        mainAxisSize: StacMainAxisSize.min,
        children: [
          StacText(data: 'Modal BottomSheet'),
          StacElevatedButton(
            child: StacText(data: 'Close BottomSheet'),
            onPressed: StacNavigateAction(navigationStyle: NavigationStyle.pop),
          ),
        ],
      ),
    ),
  ),
)
StacModalBottomSheetAction(
  assetPath: 'assets/widgets/modal_bottom_sheet.json',
)
StacModalBottomSheetAction(
  request: StacNetworkRequest(
    url: 'https://example.com/api',
    method: Method.get,
  ),
)