newValue abstract method

Object? newValue()

You should return here the value that you want to update. For example, if you want to add a new Todo to the todoList, you should return the new todoList with the new Todo added.

You can access the fields of the action, and the state, and return the new value.

Object? newValue() => state.todoList.add(newTodo);

Implementation

Object? newValue();