Skip to content

Instantly share code, notes, and snippets.

@corelmax
Created January 10, 2021 16:52
Show Gist options
  • Save corelmax/0aef6a0c3d301c1a4268d81d4953d150 to your computer and use it in GitHub Desktop.
Save corelmax/0aef6a0c3d301c1a4268d81d4953d150 to your computer and use it in GitHub Desktop.
@@ -8,7 +8,14 @@
}
}
-class TodoListState extends State<TodoList> {
+class TodoListState extends State<TodoList> {
+ Map<String, Todo> todos = {};
+
+ void addTodo(Todo todo) {
+ setState(() {
+ todos[todo.id] = todo;
+ });
+ }
Widget _buildTodoList() {
return ListView.builder(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment