Travis Griggs
11/09/2023, 8:05 PMLazyColumn(modifier = Modifier.weight(1f)) {
scanList.scans.forEach { result ->
item(key = result.device.id) {
Text(text = "${result.device.name}")
}
}
}
But this block, seeming very similar, does not update visually:
LazyColumn(modifier = Modifier.weight(1f)) {
items(items = scanList.scans, key = { result -> result.device.id }) { result ->
Text(text = "${result.device.name}")
}
}
I am scratching my head why. Is there some sort of tool, that I can fire up my UI and then see what the dependencies that are going to cause a recomposition are?mkrussel
11/09/2023, 8:18 PMTravis Griggs
11/09/2023, 8:40 PMclass ScanList {
var scans by mutableStateOf<List<ScanResult>>(emptyList())
...
(It was mutableStateList, but changing it was one of the dart throws that didn't work).
Either way, it flattens/extracts the value in both cases via scanList.scans. But one works, one does not.mkrussel
11/09/2023, 8:42 PMshikasd
11/09/2023, 8:47 PM