ToastHostState

Shows one toast at a time, like SnackbarHostState: showToast suspends until the toast is dismissed and reports how it ended; concurrent calls wait their turn. Pair it with a ToastHost and create it with rememberToastHostState.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The toast being shown, or null.

Functions

Link copied to clipboard
suspend fun showToast(message: String, icon: Painter? = null, iconContentDescription: String? = null, iconTint: Color? = null, actionLabel: String? = null, duration: ToastDuration = if (actionLabel == null) ToastDuration.SHORT else ToastDuration.LONG): ToastResult

Shows message and suspends until the toast is dismissed.