Headsup if you are working with FlowRow/FlowColumn. They don't update their content's placements if they are
key()'d
Took me a while to figure out what was going on (opened an issue โ more details in ๐งต)
๐ 1
thank you color 1
Alex Styl
01/28/2025, 6:04 AM
tldr: this won't update their positions.
removing the
key()
makes it work as expected. same code but with column/row works as expected
Copy code
var list by remember {
val value = List(5) { it.toString() }
mutableStateOf(value)
}
LaunchedEffect(Unit) {
while (true) {
list = list.shuffled()
delay(1000)
}
}
FlowRow(Modifier.fillMaxSize()) {
list.forEach {
key(it) {
Text(it)
}
}
}