bitkiller
09/14/2021, 9:54 PMMutableState<(() -> Unit)?>
)
I've been thinking about doing some kind of "confirmation dialog decorator" (confirmation or other, e.g. "request pin") for some user actions. It would be used like
var confirmationDialog: (() -> Unit)? by remember {
mutableStateOf(null)
}
if (confirmationDialog != null) {
Dialog(onOk = {
confirmationDialog?.invoke()
confirmationDialog = null
}, onCancel = {
confirmationDialog = null
})
}
SaveButton(
onClick = requireConfirmation { theRealSave() }
)
Is it too hacky? Any Zach Klippenstein (he/him) [MOD]
09/14/2021, 10:08 PMbitkiller
09/14/2021, 10:58 PMlouiscad
09/15/2021, 6:29 AMMutableState
, that's how I bridge coroutines reliant UI abstractions with state driven composables.