android4-6 Exercise 3: Add, Remove and Tags ======================================== Extra imports: Button, Row, Column, Alignment, mutableStateListOf, mutableIntStateOf, remember, getValue/setValue. @Composable fun EditableList() { val people = remember { mutableStateListOf(Contact(1, "Ada"), Contact(2, "Grace")) } var nextId by remember { mutableIntStateOf(3) } Column { Button(onClick = { people.add(Contact(nextId, "Person $nextId")); nextId++ }) { Text("Add") } LazyColumn { items(people, key = { it.id }) { person -> Row(verticalAlignment = Alignment.CenterVertically) { Text(person.name, modifier = Modifier.weight(1f).padding(8.dp)) Button(onClick = { people.remove(person) }) { Text("Remove") } } } } } } LazyRow of tags above the list (inside the Column): @Composable fun TagRow(tags: List) { LazyRow( contentPadding = PaddingValues(horizontal = 16.dp), horizontalArrangement = Arrangement.spacedBy(8.dp) ) { items(tags) { tag -> Card { Text(text = tag, modifier = Modifier.padding(12.dp)) } } } } Keys: with key = { it.id } each row keeps its identity when another is removed. Without it, rows are identified by position, so state remembered inside a row (for example a checkbox) can end up on the wrong row after a removal. A row with no remembered state may look the same either way: report what you actually see. Code unrun.