uli
05/23/2019, 5:00 PMyou
can introduce a key". and Give examples of Key() and @Pivotal. Does that mean, that the example from the post is simplified and does not trigger the group optimisation power?
@Composable fun TodoItem(item: TodoItem) {
Stack(Orientation.Horizontal) {
Text(if (item.completed) "x" else " ")
Text(item.title)
}
}
@Composable fun TodoApp(items: List<TodoItem>) {
Stack(Orientation.Vertical) {
for (item in items) {
TodoItem(item)
}
}
Text("Total: ${items.size} items")
}