title: GridView with Flutter and Firestore
body: <p>I`m trying to make a simple GridView from a cloud firestore record. I've followed a lot of video tutorials but without success. Here's the code: </p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:cloud_firestore/cloud_firestore.dart';
  
  class EventList extends StatefulWidget {
   @override
   EventListState createState() =&gt; new EventListState();
  }
  
  class EventListState extends State&lt;EventList&gt; {
    @override
    Widget build(BuildContext context) {
      return StreamBuilder(
        stream: Firestore.instance.collection('events_flutter').snapshots(),
    builder: (BuildContext context, DocumentSnapshot snapshot) {
      if (!snapshot.hasData) {
        return Center(child: const Text('Loading events...'));
      }
      return GridView.builder(
        gridDelegate:
            SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
        itemBuilder: (BuildContext context, int index) {
          return Text(snapshot['event_name']);
        },
        itemCount: snapshot.data.documents.length,
      );
    },
  );}}
  </code></pre>
  
  <p>And this is the error message when hovering on "builder: (BuildContext context, DocumentSnapshot snapshot)".
  Could anybody help me understand what is going on?</p>
  
  <p>Thanks a lot.</p>