Mark
12/07/2023, 5:08 AMFoo
being a certain type, the composable needs to handle showing a dialog. Is this way acceptable, or should the showDialog
mutable state always be kept outside of the slot composable arg?
@Composable
fun Screen(foo: Foo) {
FooView(
fooContent = {
if (foo is RareFoo) {
var showDialog by rememberSaveable {
mutableStateOf(false)
}
if (showDialog) {
RareDialog(foo) {
showDialog = false
}
}
RareFooView(foo)
} else {
NonRareFooView(foo)
}
},
...
)
}