Midoriya
09/19/2022, 4:45 AMdata class TodoItem(
val taskName :String,
val isCompleted : Boolean = false,
)
private val taskList = mutableListOf<TodoItem>()
how can i change an element 'isCompleted' to true.
so if user said 4th element is completed how can i change it to complete
taskList[index] = TodoItem(taskName = taskList[index].taskName, isCompleted = true)
like this???ephemient
09/19/2022, 4:46 AMtaskList[index] = taskList[index].copy(isCompleted = true)
Midoriya
09/19/2022, 4:50 AM