title: Read all documents from collection from firestore in Flutter
body: <p>I try to read all documents from collection as a model List from firestore like the java code.</p>
  <p>Java code is</p>
  <pre><code>FirebaseFirestore.getInstance().collection(&quot;Product&quot;).addSnapshotListener((value, error) -&gt; {
              if (!value.isEmpty()){
                  List&lt;Product&gt; productList = value.toObjects(Product.class);
              }
          });
  </code></pre>
  <p>I try in flutter</p>
  <pre><code>QuerySnapshot data;
      List&lt;DocumentSnapshot&gt; snapshot = new List&lt;DocumentSnapshot&gt;();
      List&lt;Product&gt; productList = [];
  
      data = await FirebaseFirestore.instance
          .collection('Product')
          .get();
  
      
        snapshot.addAll(data.docs);
        productList = snap.map((e) =&gt; Product.fromFirestore(e)).toList();
      
  </code></pre>
  <p>but always the list is empty, but the <strong>snapshot</strong> length is always same as my database.</p>
  <p><a href="https://i.stack.imgur.com/vA1RL.png" rel="nofollow noreferrer">database</a>
  <a href="https://i.stack.imgur.com/EW4Yi.png" rel="nofollow noreferrer">Model class</a></p>