ModalBottomSheet
Material Design modal bottom sheet.
Modal bottom sheets are used as an alternative to inline menus or simple dialogs on mobile, especially when offering a long list of action items, or when items require longer descriptions and icons. Like dialogs, modal bottom sheets appear in front of app content, disabling all other app functionality when they appear, and remaining on screen until confirmed, dismissed, or a required action has been taken.
A simple example of a modal bottom sheet looks like this:
Parameters
Executes when the user clicks outside of the bottom sheet, after sheet animates to Hidden.
Optional Modifier for the bottom sheet.
The state of the bottom sheet.
Dp that defines what the maximum width the sheet will take. Pass in Dp.Unspecified for a sheet that spans the entire screen width.
The shape of the bottom sheet.
The color used for the background of this bottom sheet
The preferred color for content inside this bottom sheet. Defaults to either the matching content color for containerColor, or to the current LocalContentColor if containerColor is not a color from the theme.
when containerColor is ColorScheme.surface, a translucent primary color overlay is applied on top of the container. A higher tonal elevation value will result in a darker color in light theme and lighter color in dark theme. See also: Surface.
Color of the scrim that obscures content when the bottom sheet is open.
Optional visual marker to swipe the bottom sheet.
window insets to be passed to the bottom sheet content via PaddingValues params.
ModalBottomSheetProperties for further customization of this modal bottom sheet's window behavior.
The content to be displayed inside the bottom sheet.