Dialog Info
This shows a simple dialog with some informational text.
Check out the composable and it's documentation in the code snipplet below.
Generally following can be adjusted:
- an optional label for the information
Composable#
/**
* Shows a dialog with an info text and an optional label for that info
*
*
*
* **Basic Parameters:** all params not described here are derived from [Dialog], check it out for more details
*
* @param info the information text for this dialog
* @param infoLabel the optional label for the information text
*/
@Composable
fun DialogInfo(
state: DialogState,
// Custom - Required
info: String,
// Custom - Optional
infoLabel: String = "",
// Base Dialog - Optional
title: (@Composable () -> Unit)? = null,
icon: (@Composable () -> Unit)? = null,
style: ComposeDialogStyle = DialogDefaults.defaultDialogStyle(),
buttons: DialogButtons = DialogDefaults.buttons(),
options: Options = Options(),
onEvent: (event: DialogEvent) -> Unit = {}
)
Example#
if (state.visible) {
DialogInfo(
state = state,
title = { Text("Dialog") },
info = "Simple Info Dialog",
icon = icon,
style = style,
onEvent = { event ->
context.showToast("Event $event")
}
)
}