NudgeState

Defines the state for managing and displaying nudges.

It includes configurations for the maximum stack size, animation, placement, and the coroutine scope used for managing nudge-related coroutines.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val animation: Animation

The animation to use for displaying nudges.

Link copied to clipboard
abstract val coroutineScope: CoroutineScope

The CoroutineScope used for managing nudge-related coroutines.

Link copied to clipboard
abstract val maxStack: Int

The maximum number of nudges that can be displayed at once.

Link copied to clipboard
abstract val placement: Placement

The placement of the nudges on the screen.

Functions

Link copied to clipboard
fun NudgeState.custom(duration: Duration = NudgeDuration.Persistent, style: Style = Style.Default, content: NudgeLayout)

Displays a customizable nudge with the specified parameters.

Link copied to clipboard
abstract fun display(model: NudgeModel)

Displays a new nudge with the provided NudgeModel.

Link copied to clipboard
fun NudgeState.display(content: NudgeBuilder.() -> Unit)

Provides a DSL for creating and displaying nudges.

Link copied to clipboard
fun NudgeState.error(title: String, description: String? = null, actions: List<NudgeButton> = emptyList(), duration: Duration = NudgeDuration.Persistent, style: Style = Style.Default)

Displays an error nudge with the specified parameters.

Link copied to clipboard
fun NudgeState.info(title: String, description: String? = null, actions: List<NudgeButton> = emptyList(), duration: Duration = NudgeDuration.Persistent, style: Style = Style.Default)

Displays an info nudge with the specified parameters.

Link copied to clipboard
fun NudgeState.loading(title: String, description: String? = null, actions: List<NudgeButton> = emptyList(), duration: Duration = NudgeDuration.Persistent, style: Style = Style.Default)

Displays a loading nudge with the specified parameters.

Link copied to clipboard
abstract fun RenderNudges(modifier: Modifier)

Renders the current list of nudges in the UI.

Link copied to clipboard

Validates the current NudgeState to ensure that it is correctly configured.

Link copied to clipboard
fun NudgeState.success(title: String, description: String? = null, actions: List<NudgeButton> = emptyList(), duration: Duration = NudgeDuration.Persistent, style: Style = Style.Default)

Displays a success nudge with the specified parameters.

Link copied to clipboard
fun NudgeState.warning(title: String, description: String? = null, actions: List<NudgeButton> = emptyList(), duration: Duration = NudgeDuration.Persistent, style: Style = Style.Default)

Displays a warning nudge with the specified parameters.