title: Get value from one future and use it in another future, with Flutter
body: <p>I have a favourites collection saved under a users collection. Each of the favourite documents has one field which contains a product_Id. I want to retrieve this product_id value and use it to query another collection. This second collection holds the actual products documents.</p>
  <p>Retrieving all the documents in the favourite collection. What do I do next to get the value of the product_id fields as strings?</p>
  <pre><code>  getIdsfromUserFavs(userId) async {
      var _favData = await _usersCollectionReference
          .doc(userId)
          .collection('favourites')
          .get();
  
  
    }
  </code></pre>
  <p>This is the second method that is used to query the products collection. This method needs the String value from above in order to successfully make the query.</p>
  <pre><code>  Future&lt;QuerySnapshot&lt;Object?&gt;&gt; queryFavsCollection(value) async {
      var _favedProducts = await _productsCollectionReference
          .where('prod_id', isEqualTo: value)
          .get();
      print(value);
      return _favedProducts;
    }
  </code></pre>
  <p>I am using a futureBuilder in the UI.</p>
  <p>THis is one way I have tried(The problem with this is that I don't get any data returned):</p>
  <pre><code>  getIdsfromUserFavs(userId) async {
      var _favData = await _usersCollectionReference
          .doc(userId)
          .collection('favourites')
          .get();
  
      var allData = _favData.docs.map((doc) =&gt; doc.data()).toList();
      allData.forEach((element) async {
        String value = element['prod_id'];
        print(value);
        await queryFavsCollection(value);
      });
    }
  
  
    Future&lt;QuerySnapshot&lt;Object?&gt;&gt; queryFavsCollection(value) async {
      var _favedProducts = await _productsCollectionReference
          .where('prod_id', isEqualTo: value)
          .get();
      print(value);
      return _favedProducts;
    }
  </code></pre>
  <p>I can see that the above methods print the ids to the console. But the FutureBuilder doesn't receive any data:</p>
  <pre><code>I/flutter ( 4628): 3nHHEWuCDXvbhYfT8ljY
  I/flutter ( 4628): MptYFV1oXhflDYkdQyIP
  I/flutter ( 4628): Fd2ntXyNVmjn0D6mG3RA
  </code></pre>