I think you are following some old documentation or tutorial. As far as I remember, object of QuerySnapshot has been changed few months ago.
They have simplified the usage by changing documents to docs and document to doc.
So your code should be like this
SearchService().searchProduct(value).then((QuerySnapshot docs){
for(int i = 0; i < docs.docs.length; i++) {
queryResult.add(docs.docs[i].data);
}
});
You can review the changelog here
https://gist.github.com/Salakar/a36bd0902d7d0c705696da9318cf4e71
Updated - 03/01/2023
After testing few different codes with firebase, I was able to get some solution. But I tried that in javascript based code so I am making few changes which should work on flutter as well.
So just try these with your code & see if it works for you. To get the text based search you can use something like
users
.where("name", isGreaterThanOrEqualTo: "Aa");
This will start searching for the names starting 'Aa' but will not stop on this and continue search after that.
To stop the searching after matching these following text try implementing something like this.
users
.where("name", isGreaterThanOrEqualTo: "Aa")
.where("name", isLessThanOrEqualTo: "Aa"+ '\uf8ff');
This will stop looking for record as soon as the first two digits changes. Similar code for js is working for me on svelte + firebase setup.
I still don't know how to search in between the text. But there are some third party tools you can use which are mentioned on there documents here https://firebase.google.com/docs/firestore/solutions/search.
I looked into some reference stack-overflow answers & some articles but unfortunately I don't have those tabs opens right now so can't share all the sources.
One of those sources is this Google Firestore: Query on substring of a property value (text search)
> getuserList({String? query}) async { var url = Uri.parse(urlList); try { var response = await http.get(url); if (response.statusCode == 200) {