implemented undo button and proper sorting

This commit is contained in:
SomnusVeritas
2023-11-08 12:57:45 +01:00
parent 91ce231b04
commit c9deb726e0
4 changed files with 29 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ class DbHelper {
}
static List<Todo> fetchTodos() =>
_isar.todos.where().doneEqualTo(false).findAll();
_isar.todos.where().doneEqualTo(false).sortByCreatedAtDesc().findAll();
static void addOrUpdateTodo(Todo todo) =>
_isar.write((isar) => isar.todos.put(todo));