title: Flutter Error: type 'Future<dynamic>' is not a subtype of type 'List<Game>'
body: <p>I am trying to build an app with different lists of games. As a backend I use Firebase and the connection is working fine, I tested it. Anyway I have problems with replacing the mock data with real data from firebase. I always get this error:</p>
  
  <blockquote>
    <p>type 'Future &lt; dynamic>' is not a subtype of type 'List &lt; Game>'</p>
  </blockquote>
  
  <p>I have following function:</p>
  
  <pre><code>getGames() async{
   List newGamesList = [];
  
    QuerySnapshot result = awaitFirestore.instance.collection('products').getDocuments();
    List&lt;DocumentSnapshot&gt; documents = result.documents;
    documents.forEach((DocumentSnapshot doc) {
    Game game = new Game.fromDocument(doc);
    newGamesList.add(game);
  
  });
  }
  </code></pre>
  
  <p>"Game" looks like that:</p>
  
  <pre><code>factory Game.fromDocument(DocumentSnapshot document) {
  
  return new Game(
    name: document['name'],
    box: document['box'],
    cover: document['cover'],
    description: document['description'],
  
  );
  }
  </code></pre>
  
  <p>In my build widget I call "getGames":</p>
  
  <pre><code>new HorizontalGameController(getGames()),
  </code></pre>
  
  <p>Any idea why this error occures and how to solve that? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>For better understanding here is my HorizontalGameController:</p>
  
  <pre><code>class HorizontalGameController extends StatelessWidget {
  HorizontalGameController(this.gameItems);
  final List&lt;Game&gt; gameItems;
  
  @override
  Widget build(BuildContext context) {
  return new SizedBox.fromSize(
    size: const Size.fromHeight(240.0),
    child: new ListView.builder(
        itemCount: 1,
        scrollDirection: Axis.horizontal,
        padding: const EdgeInsets.only(left: 12.0, top: 4.0),
        itemBuilder: (BuildContext context, int position) {
          return GameContainerItem(context, gameItems[position]);
        }),
  );
  }
  }
  </code></pre>