How to add modifier in rememberScaffoldState of snackbarHostState?

27 Views Asked by At

So, I've been following this article. The code below shows the snackbar state, how do I add modifier in the below code so that I can have the snackbar show in top or bottom area. My goal is to somehow add a modifier section in the snackbar to change it's color and position it.

@Composable
fun SnackbarDemoApp() {
    SnackbarDemoTheme {

    val appState: SnackbarDemoAppState = rememberSnackbarDemoAppState()

    Scaffold(
        scaffoldState = appState.scaffoldState
    ) {
        MyNavigation(
            navController = appState.navController,
            showSnackbar = { message, duration ->
                appState.showSnackbar(message = message, duration = duration)
            }
        )
    }
}

}

0

There are 0 best solutions below