DisplaySnackbar

fun EventSchemaBuilderScope.DisplaySnackbar(id: String = randomId(), trigger: EventTrigger, message: String, duration: DisplaySnackbarEventSchema.SnackbarDuration = snackbarShortDuration(), actionLabel: String? = null, events: EventSchemaBuilderScope.() -> Unit = {})

Shows a snackbar with message, by broadcasting a display command on the screen channel. duration maps onto Material's short/long/indefinite durations, and actionLabel adds an action button when non-null. Does not consume incomingData. Dispatches onSuccess (no data) right after the command is broadcast, before the snackbar has resolved — the broadcast is fire-and-forget, so this fires regardless of what the snackbar does next; later, onSnackbarAction (no data) when the user presses the action button, or onSnackbarDismissed (no data) when the snackbar goes away without its action being pressed.

Parameters

id

Unique identifier of this event. Defaults to a random id.

trigger

Trigger that fires this event, built via EventTriggers.

message

Text shown in the snackbar.

duration

How long the snackbar stays visible — snackbarShortDuration, snackbarLongDuration or snackbarIndefiniteDuration. Defaults to short.

actionLabel

Label of the snackbar's action button. Defaults to none (no action button).

events

Child events chained after this one, wired to its triggers (onSuccess, onSnackbarAction, onSnackbarDismissed).