Reputation: 12293
So I'm trying to define BottomSheet as navigation routes using compose.material.navigation.bottomSheet
based on the example from official docs:
val bottomSheetNavigator = rememberBottomSheetNavigator()
val navController = rememberNavController(bottomSheetNavigator)
ModalBottomSheetLayout(bottomSheetNavigator) {
NavHost(navController, Destinations.Home) {
composable(Destinations.Home) {
HomeScreen(
showSheet = {
navController.navigate(Destinations.Sheet + "?arg=From Home Screen")
},
showFeed = { navController.navigate(Destinations.Feed) }
)
}
composable(Destinations.Feed) { Text("Feed!") }
bottomSheet(Destinations.Sheet + "?arg={arg}") { backstackEntry ->
val arg = backstackEntry.arguments?.getString("arg") ?: "Missing argument :("
BottomSheet(
showFeed = { navController.navigate(Destinations.Feed) },
showAnotherSheet = {
navController.navigate(Destinations.Sheet + "?arg=${UUID.randomUUID()}")
},
arg = arg
)
}
}
}
but it gives this warning
Using a material import while also using the material3 library
and I can't find out if such functionality available withing material3 libraries
Upvotes: 0
Views: 66
Reputation: 10887
Please have a look at Ticket #328949006 at the Google Issue Tracker. It seems that this functionality is currently not supported with Material3
, but there are some alternatives:
BottomSheet
at a time)You can star the issue in the Issue Tracker and leave a comment to draw more attention to it.
Upvotes: 1
Reputation: 8362
This just means you are mixing Material2 and Material3 components.
Upvotes: 0