todolist watches for changes on db

This commit is contained in:
SomnusVeritas
2023-11-08 11:39:12 +01:00
parent 15c404c962
commit 11a6469544
2 changed files with 15 additions and 1 deletions

View File

@@ -18,4 +18,7 @@ class DbHelper {
static List<Todo> fetchTodos() => _isar.todos.where().findAll();
static void addTodo(Todo todo) => _isar.write((isar) => isar.todos.put(todo));
static Stream<void> watchTodos() =>
_isar.todos.watchLazy(fireImmediately: true);
}