showSnackBar

suspend fun ScaffoldState.showSnackBar(message: String, duration: SnackbarDuration = SnackbarDuration.Short, onDismissed: () -> Unit = {})

Shows a Snackbar at the bottom of the Scaffold.

Parameters

message

text to be shown in the Snackbar

duration

duration to control how long snackbar will be shown in SnackbarHost, either SnackbarDuration.Short, SnackbarDuration.Long or SnackbarDuration.Indefinite

onDismissed

function executed when the Snackbar is dismissed because the duration expires or the user close it


suspend fun BottomSheetScaffoldState.showSnackBar(message: String, duration: SnackbarDuration = SnackbarDuration.Short, onDismissed: () -> Unit = {})

Shows a Snackbar at the bottom of the BottomSheetScaffold.

Parameters

message

text to be shown in the Snackbar

duration

duration to control how long snackbar will be shown in SnackbarHost, either SnackbarDuration.Short, SnackbarDuration.Long or SnackbarDuration.Indefinite

onDismissed

function executed when the Snackbar is dismissed because the duration expires or the user close it