title: Get Firestore documents with a field that is equal to a particular string in flutter
body: <p>I am trying to get documents in a collection that have a particular field that equals a particular string. I am building a POS and I want to get all the sales for a particular city.</p>
  <pre><code>final FirebaseFirestore _firestore = FirebaseFirestore.instance;
  final CollectionReference _mainCollection = _firestore.collection('Sales');
  
  
    Stream&lt;QuerySnapshot&gt; readFeeds() {
      CollectionReference notesItemCollection =
      _mainCollection.where('seller_location', isEqualTo: &quot;London&quot;).get();
  
      return notesItemCollection.snapshots();
    }
  
  </code></pre>
  <p>I am getting this error:</p>
  <blockquote>
  <p>A value of type 'Future&lt;QuerySnapshot&lt;Object?&gt;&gt;' can't be assigned to a variable of type 'CollectionReference&lt;Object?&gt;'.</p>
  </blockquote>
  <p>I have cast added cast <code>as CollectionReference&lt;Object?&gt;;</code> but the query is still not working. This is how I am accessing the data:</p>
  <pre><code>  @override
    Widget build(BuildContext context) {
      return StreamBuilder&lt;QuerySnapshot&gt;(
        stream: readFeeds(),
        builder: (context, snapshot) {
          if (snapshot.hasError) {
            return Text('Something went wrong');
          } else if (snapshot.hasData || snapshot.data != null) {
            return ListView.separated(
              separatorBuilder: (context, index) =&gt; SizedBox(height: 16.0),
              itemCount: snapshot.data!.docs.length,
              itemBuilder: (context, index) {
                var noteInfo = snapshot.data!.docs[index];
                String docID = snapshot.data!.docs[index].id;
                String name = noteInfo['name'].toString();
                String price = noteInfo['price'].toString();
                String quantity = noteInfo['quantity'].toString();
                return Ink(
                  decoration: BoxDecoration(
                    color: CustomColors.firebaseGrey.withOpacity(0.1),
                    borderRadius: BorderRadius.circular(8.0),
                  ),
                  child: ListTile(
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(8.0),
                    ),
                    onTap: () =&gt; Navigator.of(context).push(
                      MaterialPageRoute(
                        builder: (context) =&gt; EditScreen(
                          documentId: docID,
                          currentName: name,
                          currentPrice: price,
                          currentQuantity: quantity,
                        ),
                      ),
                    ),
                    title: Text(
                      name,
                      maxLines: 1,
                      overflow: TextOverflow.ellipsis,
                      style: TextStyle(color: Colors.white),
                    ),
                  ),
                );
              },
            );
          }
          return Center(
            child: CircularProgressIndicator(
              valueColor: AlwaysStoppedAnimation&lt;Color&gt;(
                CustomColors.firebaseOrange,
              ),
            ),
          );
        },
      );
    }
  }
  </code></pre>