Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Отсяда видно как перехожу к ботомшиту
- @OptIn(ExperimentalAnimationApi::class)
- @Composable
- @Destination
- @RootNavGraph(start = true)
- fun HomeScreen(navigator: NavController)
- {
- val viewModel = viewModel<HomeScreenViewModel>()
- HomeScreenContent(
- items = viewModel.items,
- onAdd = {
- navigator.navigateTo(EditBookScreenDestination)
- {
- launchSingleTop = true
- restoreState = true
- }
- },
- onRemove = viewModel::onClickRemoveBook
- )
- }
- // сам ботомшит
- @OptIn(ExperimentalMaterialNavigationApi::class, ExperimentalMaterial3Api::class)
- @ExperimentalAnimationApi
- @Destination()
- @Composable
- fun EditBookScreen(navigator:NavController) {
- ModalBottomSheet(onDismissRequest = {
- navigator.navigateTo(HomeScreenDestination)
- {
- launchSingleTop = true
- restoreState = true
- popUpTo(NavGraphs.root)
- {
- }
- }
- })
- {......}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement