title: flutter:getting data from firebase
body: <pre><code>Stream&lt;QuerySnapshot&gt; readDocument() {
      return _firestore.collection(&quot;uploads&quot;).snapshots();
    }
  </code></pre>
  <p>This is my stream method that get data from related collection.</p>
  <pre><code>body: StreamBuilder&lt;QuerySnapshot&gt;(
            stream: Provider.of&lt;FirebaseServices&gt;(context).readDocument(),
            builder: (context, snapshot) {
              if (!snapshot.hasData) {
                return Center(child: CircularProgressIndicator());
              } else if (snapshot.hasError) {
                return Center(
                  child: Text(&quot;error&quot;),
                );
              } else {
                QuerySnapshot? data = snapshot.data;
                List&lt;DocumentSnapshot&gt; list = [];
                if (data != null) {
                  list = data.docs;
                }
                return ListView.builder(
                  itemCount: list.length,
                  itemBuilder: (context, index) {
                    return NoteViewWidget();//some widget 
                  },
                );
              }
            }),
  </code></pre>
  <p>but when i executed the app,list variable is remaining empty but collection is not
  i cannot find my mistake.</p>
  <p>if i add a document manuel to the uploads collection i can fetch the that data but cant fetch the data that created by app.</p>