Fill in the blanks in the provided Jetpack Compose Scaffold code snippet to correctly implement a snackbar.
Scaffold
Triggering Snackbar
Report a typo
Fill in the gaps with the relevant elements
@Composable
fun SnackPage() {
val snackbarHostState = remember {
}
val scope = rememberCoroutineScope()
Scaffold(
snackbarHost = {
(
hostState = ,
snackbar = { snackbarData ->
(snackbarData = snackbarData)
}
)
},
floatingActionButton = {
FloatingActionButton(
onClick = {
.launch {
snackbarHostState.showSnackbar("Hello, I'm a snackbar!")
}
}
) { /*...*/ }
}
) {
SnackContent(modifier = Modifier.padding(it))
}
}Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.