I Want to Search from by firebase database, But When space in between a name then it does not works at all. So what can i do now.. it works before space is given....
Code:
stream: (searchString==null || searchString.trim()=='')?
Firestore.instance.collection('ebook').snapshots() : Firestore.instance.collection('ebook')
.where('searchIndex',arrayContains: searchString)
//.where('organization',isEqualTo: searchString )
.snapshots(),
Try adding the following:
.where("searchIndex", isGreaterThanOrEqualTo: searchString) //String comparison
.where('searchIndex', isLessThan: searchString + 'z') //Shows all results until the letter ends with a Z, so this should include spacebar
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.