Mark
02/01/2023, 9:32 AMDialog
. To achieve this, I have a state of MutableList
which is initially empty and then populated via a LaunchedEffect
. Even though the state is successfully updated, the Dialog does not show the items. Is this something to do with limitations in updating Dialog’s contents, or am I doing something fundamentally wrong?var items by remember {
mutableStateOf<List<Item>>(emptyList())
}
LaunchedEffect(true) {
items = calculateItems()
}
if (items.isNotEmpty()) {
MyDialog(items, onDismissRequest)
}
although I’m not sure why it wasn’t also working when the LaunchedEffect
was specified within the MyDialog
composable.Mini
02/01/2023, 10:46 AMval items = produceState(emptyList()){
value = calculateItems()
}
Mark
02/11/2023, 4:53 AM