PromptDialogModel

A model for an individual prompt dialog that presents ParametersT to the user and obtains ResultT response from them.

Individual dialog types should subclass this class using appropriate types for ParametersT and ResultT, creating a new dialog type (by implementing DialogType) and return it from dialogType property.

Each dialog model should be registered in the PromptModel using PromptModel.Builder.addPromptDialogModel and bound to UI which should collect dialogState flow (e.g. collectAsState in Compose UI).

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
class DialogShownState<ParametersT, ResultT>(val parameters: ParametersT, val resultChannel: SendChannel<ResultT>) : PromptDialogModel.DialogState<ParametersT, ResultT>

Prompt dialog should be displayed.

Link copied to clipboard

A class that describes the state of the dialog.

Link copied to clipboard
Link copied to clipboard

Prompt dialog should not be shown.

Properties

Link copied to clipboard

True if this model is bound to the UI.

Link copied to clipboard

The state of this dialog.

Link copied to clipboard

Dialog type that this model servers.

Functions

Link copied to clipboard
suspend fun displayPrompt(parameters: ParametersT, lingerDuration: Duration = 0.seconds): ResultT

Request UI to display a prompt dialog and obtain a response from the user.