Created
January 10, 2021 16:52
-
-
Save corelmax/0aef6a0c3d301c1a4268d81d4953d150 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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