public class BottomSheetNavigator(internal val sheetState: ModalBottomSheetState) :
Navigator<BottomSheetNavigator.Destination>()
Navigator that drives a ModalBottomSheetState for use of ModalBottomSheetLayouts with the navigation library. Every destination using this Navigator must set a valid Composable by setting it directly on an instantiated Destination or calling androidx.compose.material.navigation.bottomSheet.
The sheetContent Composable will always host the latest entry of the back stack. When navigating from a BottomSheetNavigator.Destination to another BottomSheetNavigator.Destination, the content of the sheet will be replaced instead of a new bottom sheet being shown.
When the sheet is dismissed by the user, the state's NavigatorState.backStack will be popped.
Parameters
| sheetState | The ModalBottomSheetState that the BottomSheetNavigator will use to drive the sheet state |
Properties
navigatorSheetState
public val navigatorSheetState: BottomSheetNavigatorSheetState =
BottomSheetNavigatorSheetState(sheetState)
Access properties of the ModalBottomSheetLayout's ModalBottomSheetState
Functions
onAttach
override fun onAttach(state: NavigatorState)
createDestination
override fun createDestination(): Destination
navigate
override fun navigate(
entries: List<NavBackStackEntry>,
navOptions: NavOptions?,
navigatorExtras: Extras?,
)
popBackStack
override fun popBackStack(popUpTo: NavBackStackEntry, savedState: Boolean)
Members
Destination
public class Destination(
navigator: BottomSheetNavigator,
internal val content: @Composable ColumnScope.(NavBackStackEntry) -> Unit,
) : NavDestination(navigator), FloatingWindow
NavDestination specific to BottomSheetNavigator.
Parameters
| navigator | The navigator used to navigate to this destination |
| content | The content to be displayed for this destination |