I'm trying to display a snackbar in jetpack compos...
# compose
p
I'm trying to display a snackbar in jetpack compose, but it is not displaying the right X close button present on the sample of the documentation. Instead, it's displaying just the message. I can't find anywhere how to display that X close button.
Copy code
val snackbarHostState = remember { SnackbarHostState() }
SnackbarHost(hostState = snackbarHostState)

uiState.toastMessage?.let {
    val message = stringResource(it)
    LaunchedEffect(key1 = message) {
        snackbarHostState.showSnackbar(
            message = message,
            duration = SnackbarDuration.Indefinite
        )
        vm.toastMessage(null)
    }
}
p
Did you try
Copy code
snackbarHostState.showSnackbar(
            message = message,
            withDismissAction = true,
            duration = SnackbarDuration.Indefinite
        )
🙌 1
s
As well, make sure that your close button isn't the same color as your snackbar's background