I have created an app that stores some notes in sqlite database. I did all CRUD operations and it's working well, but when I'm trying to make search operation inside my database with SearchDelegate, I am not getting any data in search bar . My code is here please go through it and help.I am stuck since 4 days.I think my query is in suggestion is wrong please help me writing query.
--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/9b6531de-9979-412f-b0e8-e0e79d8a70cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shouldn't your constructor be 'DataSearch(this.items);' not ' DataSearch(this.suggestion);'? As you have it, you are never setting 'items' (except to create an empty list), but then dofinal suggestion = query.isEmpty ? items :items.where((target) => target.title.startsWith(query)).toList();but 'items' will always be an empty list.
On 25 May 2019, 12:32 +0100, mahantappa b k <mbkum...@gmail.com>, wrote:
I have created an app that stores some notes in sqlite database. I did all CRUD operations and it's working well, but when I'm trying to make search operation inside my database with SearchDelegate, I am not getting any data in search bar . My code is here please go through it and help.I am stuck since 4 days.--I think my query is in suggestion is wrong please help me writing query.
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutt...@googlegroups.com.
class DataSearch extends SearchDelegate<Note> {
DatabaseHelper db = new DatabaseHelper();
final List<Note> items = new List();
List<Note> suggestion = new List();
// ListViewNoteState i = ListViewNoteState();
DataSearch(this.suggestion);
class DataSearch extends SearchDelegate<Note> {
DatabaseHelper db = new DatabaseHelper();
final List<Note> items = new List();
List<Note> suggestion = new List();
// ListViewNoteState i = ListViewNoteState();
DataSearch(this.items);
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/bb2e1741-cb4a-45d2-bb2b-72b232fcfcef%40googlegroups.com.
class DataSearch extends SearchDelegate<Note> {
DatabaseHelper db = new DatabaseHelper();List<Note> items = new List();
List<Note> suggestion = new List();
// ListViewNoteState i = ListViewNoteState();
DataSearch(this.items);return new ListTile(title: Text(items[position].title.toString()),);
return new ListTile(title: Text(suggestion[position].title.toString()),
);
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/a95f998e-7a21-4db0-85b0-da514de91a1d%40googlegroups.com.