rememberDialogState

fun <T : Any> rememberDialogState(data: T?, saver: Saver<MutableState<T?>, out Any> = autoSaver(), buttonPositiveEnabled: Boolean = true, buttonNegativeEnabled: Boolean = true, dismissAllowed: Boolean = true, swipeAllowed: Boolean = true): DialogStateWithData<T>

returns a DialogStateWithData object holding all necessary states for the dialog

Consider using rememberDialogState(showing: Boolean, ...) if you do not need any data for this dialog

Parameters

data

the initial data of this state (should nearly always be null which means that the dialog is not visible initially)

saver

the Saver for the holded data (autoSaver will be used by default which will work for all types that are supported by Bundle)

buttonPositiveEnabled

define if the positive button should be enabled initially or not

buttonNegativeEnabled

define if the negative button should be enabled initially or not

dismissAllowed

define if the dialog can be initially dismissed or not

swipeAllowed

define if the dialog can be initially swiped away or not


fun rememberDialogState(visible: Boolean = false, buttonPositiveEnabled: Boolean = true, buttonNegativeEnabled: Boolean = true, dismissAllowed: Boolean = true, swipeAllowed: Boolean = true): DialogStateNoData

returns a DialogStateNoData object holding all necessary states for the dialog

Consider using rememberDialogState with the data field overload if you do need some data inside the dialog if it is shown

Parameters

visible

the initial visibility state

buttonPositiveEnabled

define if the positive button should be enabled initially or not

buttonNegativeEnabled

define if the negative button should be enabled initially or not

dismissAllowed

define if the dialog can be initially dismissed or not

swipeAllowed

define if the dialog can be initially swiped away or not