BottomSheetNavigator

class BottomSheetNavigator(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.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.

Parameters

sheetState

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

Constructors

BottomSheetNavigator
Link copied to clipboard
fun BottomSheetNavigator(sheetState: ModalBottomSheetState)
The ModalBottomSheetState that the BottomSheetNavigator will use to drive the sheet state

Types

Destination
Link copied to clipboard
class Destination(navigator: BottomSheetNavigator, content: @Composable() ColumnScope.(NavBackStackEntry) -> Unit) : NavDestination, FloatingWindow

Functions

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

Properties

isAttached
Link copied to clipboard
var isAttached: Boolean
navigatorSheetState
Link copied to clipboard
val navigatorSheetState: BottomSheetNavigatorSheetState
Access properties of the ModalBottomSheetLayout's ModalBottomSheetState
sheetContent
Link copied to clipboard
val sheetContent: @Composable() ColumnScope.() -> Unit
A Composable function that hosts the current sheet content.