florent
03/07/2021, 12:53 PMDenis
03/07/2021, 12:55 PMflorent
03/07/2021, 12:59 PMDenis
03/07/2021, 1:01 PMonTextChange
and onEditItemChange
look like?florent
03/07/2021, 1:04 PMonTextChange = { onEditItemChange(item.copy(task = it)) }
and
fun onEditItemChange(item: TodoItem) {
val currentItem = requireNotNull(currentEditItem)
require(currentItem.id == item.id) {
"You can only change an item with the same id as currentEditItem"
}
todoItems = todoItems.toMutableList().also {
it[currentEditPosition] = item
}
}
Denis
03/07/2021, 1:10 PMit
what you'd expect it to be in onTextChange
?
(sorry for generic questions, can't load the project right now)florent
03/08/2021, 1:26 PM