BottomSheetNavigator

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.navigation.compose.material.bottomSheet.

The sheetContent 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.

The primary constructor is not intended for public use. Please refer to rememberBottomSheetNavigator instead.

Parameters

sheetState

The ModalBottomSheetState that the BottomSheetNavigator will use to drive the sheet state

Constructors

Link copied to clipboard
constructor(sheetState: ModalBottomSheetState)

Functions

Link copied to clipboard
Link copied to clipboard
open fun navigate(destination: BottomSheetNavigator.Destination, args: Bundle?, navOptions: NavOptions?, navigatorExtras: Navigator.Extras?): NavDestination?
open override fun navigate(entries: List<NavBackStackEntry>, navOptions: NavOptions?, navigatorExtras: Navigator.Extras?)
Link copied to clipboard
open override fun onAttach(state: NavigatorState)
Link copied to clipboard
open fun onLaunchSingleTop(backStackEntry: NavBackStackEntry)
Link copied to clipboard
open fun onRestoreState(savedState: Bundle)
Link copied to clipboard
open fun onSaveState(): Bundle?
Link copied to clipboard
open fun popBackStack(): Boolean
open override fun popBackStack(popUpTo: NavBackStackEntry, savedState: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard

A Composable function that hosts the current sheet content. This should be set as sheetContent of your ModalBottomSheetLayout.