Hi there I am building a flutter e commerce app. In searching stage I tried to use typeahead plugin but it didn't work at all. What is the best way of instant search in flutter app which has backend in firestore. I want to find all data which has typed pattern. (Like typed = "a", results: "ba", "dca", "ax"....) The plugin is not a must for me, I only want to instantly search products, categories by typing.
I could not return the list to typeahead widget;
getSuggestion(pattern){
documentList = (await Firestore.instance
.collection("cases")
.document(await firestoreProvider.getUid())
.collection(caseCategory)
.where("caseNumber", isGreaterThanOrEqualTo: query)
.getDocuments())
.documents;
return documentList;
}
Widget ;
TypeAheadFormField(
textFieldConfiguration: TextFieldConfiguration(
controller: this._typeAheadController,
decoration: InputDecoration(
labelText: 'City'
)
),
suggestionsCallback: (pattern) {
return getSuggestions(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
......