diff --git a/lib/data/app_database.dart b/lib/data/app_database.dart index 1c8484c..555b778 100644 --- a/lib/data/app_database.dart +++ b/lib/data/app_database.dart @@ -217,13 +217,15 @@ class AppDatabase extends _$AppDatabase { } Future> getDeletedNotes() { - return (select(notes)..where( - (n) => - n.isDeleted.equals(true) & - n.title.isNotValue('') & - n.body.isNotValue(''), - )) - .get(); + // A note is considered deleted (in the trash) when `is_deleted` is true + // and at least one of `title` or `body` is not empty. Previously the + // query required both title AND body to be non-empty which excluded + // notes that had an empty body (common) from appearing in the trash. + return (select(notes)..where( + (n) => n.isDeleted.equals(true) & + (n.title.isNotValue('') | n.body.isNotValue('')), + )) + .get(); } Future> getCategoriesChangedSince(DateTime since) {