hi and hello everyone ,
i am new with flutter and dart
and i am start using isar database
and everything is good and ok
but i have problem with Search
i create function for search
getAll(String search) async* {
final isar = await db;
final query = isar.books
.where()
.filter()
.titleContains(search)
.build();
await for (final results in query.watch(fireImmediately: true)) {
if (results.isNotEmpty) {
yield results;
}
}
}
and i add Search i home screen like this in TextField :
onChanged: (value) {
isarService.getAll(search: value);
}
,
but not work with me i try everthing but no work
soory for my english
2
Answers
maybe you should wait for the response:
Inside your getAllBooks() just remove .build()
Convert your book_list_screen.dart class in StatefulWidget, and use a variable.
Inside your TextField’s onChanged()
and inside your Expanded widget use something like this