Search: All look in the title

Fixes #64
This commit is contained in:
Vishesh Handa
2020-02-17 14:58:28 +01:00
parent b4d718b131
commit 9f2fa7c3e4

View File

@ -66,6 +66,9 @@ class NoteSearchDelegate extends SearchDelegate<Note> {
// TODO: This should be made far more efficient
var q = query.toLowerCase();
var filteredNotes = notes.where((note) {
if (note.title.toLowerCase().contains(q)) {
return true;
}
return note.body.toLowerCase().contains(q);
}).toList();