I'm working on a Compose Multiplatform project usi...
# compose
y
I'm working on a Compose Multiplatform project using NavigationSuiteScaffold as the main layout. Unlike the standard Scaffold, NavigationSuiteScaffold doesn't have a snackbarHost parameter, so I'm unsure how to integrate snackbars into my layout to notify users about actions or events. Here’s a snippet of my current implementation:
NavigationSuiteScaffold(
layoutType = layoutType,
navigationSuiteItems = { /* Navigation items */ }
) {
NavHost(
navController = navController,
Copy code
startDestination = Screen.ChatScreen.route,
) {
// Composable screens...
}
}
And here's how I would typically add a
SnackbarHost
with `Scaffold`:
Scaffold(
snackbarHost = {
SnackbarHost(hostState = snackbarHostState)
},
content = { padding ->
// Screen content...
}
)
s
You'll wanna wrap the code in code blocks for easier readability, using three backticks (`).
While I never worked with
NavigationSuiteScaffold
, a quick look at its documentation and API parameters makes it clear that it isn't meant as a replacement for
Scaffold
.
It seems to me that the easiest way is just using a
Scaffold
as your content, and defining your scaffold (and any other stuff like FAB, top app bar, etc..) as usual.
y
I want to use NavigationSuiteScaffold for larger screens. Here's how the layout looks
s
I think you misunderstood my message, I meant that you can put a
Scaffold
inside the
NavigationSuiteScaffold
.
Copy code
NavigationSuiteScaffold(...) {
    Scaffold(
        snackbarHost = { SnackbarHost(...) }
    ) {
        // your content here
    }
}
1
🙏 1
👍 1
y
the snackbar works now. Thank you for the help
🙌 1