I'm trying to build a search functionality where a text entered in my search field is search through two fields in my Firestore(profileName and username). For example, if a user has the profileName 'Sylvester Appiah' and username 'keeett'. Then when either the username or profileName is searched it should return the same user. I'm not sure if I can do profileName or username inside the .where() method. Any help is appreciated!
controlSearch(String searchWord){
Future<QuerySnapshot>pUsers=usersReference
.where("profileName",isGreaterThanOrEqualTo:searchWord)
.getDocuments();
setState(() {
futureSearchResult = pUsers;
});
}