SnackbarController

Controls snackbar presentation through SnackbarHostState.

Provides explicit operations for showing, replacing, and dismissing snackbars while preserving the suspending semantics of SnackbarHostState.

Controls snackbar presentation through SnackbarHostState.

Provides explicit operations for showing, replacing, and dismissing snackbars while preserving the suspending semantics of SnackbarHostState.

Controls snackbar presentation through SnackbarHostState.

Provides explicit operations for showing, replacing, and dismissing snackbars while preserving the suspending semantics of SnackbarHostState.

Constructors

Link copied to clipboard
constructor(snackbarHostState: SnackbarHostState, context: Context)
constructor(snackbarHostState: SnackbarHostState)

Properties

Link copied to clipboard

Visuals of the currently shown snackbar, or null if none is shown.

Visuals of the currently shown snackbar, or null if none is shown.

Visuals of the currently shown snackbar, or null if none is shown.

Link copied to clipboard
actual val isShowing: Boolean

Whether a snackbar is currently being shown.

expect val isShowing: Boolean

Whether a snackbar is currently being shown.

actual val isShowing: Boolean

Whether a snackbar is currently being shown.

Functions

Link copied to clipboard
actual fun dismissCurrent()

Dismisses the currently shown snackbar, if any.

expect fun dismissCurrent()

Dismisses the currently shown snackbar, if any.

actual fun dismissCurrent()

Dismisses the currently shown snackbar, if any.

Link copied to clipboard
actual suspend fun replaceCurrentWith(visuals: SnackbarVisuals): SnackbarResult

Dismisses the currently shown snackbar before showing visuals.

suspend fun replaceCurrentWith(makeSnackbar: Context.() -> SnackbarVisuals): SnackbarResult

Dismisses the currently shown snackbar before showing visuals created with this controller's Context.

expect suspend fun replaceCurrentWith(visuals: SnackbarVisuals): SnackbarResult

Dismisses the currently shown snackbar before showing visuals.

actual suspend fun replaceCurrentWith(visuals: SnackbarVisuals): SnackbarResult

Dismisses the currently shown snackbar before showing visuals.

Link copied to clipboard
actual suspend fun show(visuals: SnackbarVisuals): SnackbarResult

Shows visuals and suspends until the snackbar is dismissed or its action is performed.

suspend fun show(makeSnackbar: Context.() -> SnackbarVisuals): SnackbarResult

Shows snackbar visuals created with this controller's Context.

expect suspend fun show(visuals: SnackbarVisuals): SnackbarResult

Shows visuals and suspends until the snackbar is dismissed or its action is performed.

actual suspend fun show(visuals: SnackbarVisuals): SnackbarResult

Shows visuals and suspends until the snackbar is dismissed or its action is performed.