Replace function ;
dynamic newTodoItem(String text, [ItemPriority priority]) {
this.setState(() {
todos.add(new TodoItem(text, priority));
});
return some.. or null;
}
CLICK HERE to find out more related problems solutions.