SnackbarManager

A global manager for displaying snackbars across the application. This allows ViewModels to trigger transient feedback messages without direct dependencies on UI components or SnackbarHostState.

Events are buffered in a Channel and consumed exactly once by the host composable via MeshtasticSnackbarHost.

See also

for the modal dialog equivalent.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class SnackbarEvent(val message: String, val actionLabel: String? = null, val withDismissAction: Boolean = false, val duration: SnackbarDuration = SnackbarDuration.Short, val onAction: () -> Unit? = null)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun showSnackbar(message: String, actionLabel: String? = null, withDismissAction: Boolean = false, duration: SnackbarDuration = if (actionLabel != null) SnackbarDuration.Indefinite else SnackbarDuration.Short, onAction: () -> Unit? = null)