replaceCurrentWith

Launches replacement of the currently shown snackbar with visuals created with the associated Context.

Dismisses the currently showing snackbar if there is one and shows a new one with the given snackbarVisuals.

See also


suspend fun SnackbarHostState.replaceCurrentWith(message: String, actionLabel: String? = null, withDismissAction: Boolean = false, duration: SnackbarDuration = if (actionLabel == null) SnackbarDuration.Short else SnackbarDuration.Indefinite): SnackbarResult

Dismisses the currently showing snackbar if there is one and shows a new one with the given parameters.

See also