title: Gridview.builder with Firebase realtime database and futurebuilder
body: <p>Coming from Firestore, I am a little bit struggling how to receive data from Firebase real time database. I just want a nice grid view of images which are loaded from the realtime database.</p>
  
  <pre><code>Error: flutter: The following NoSuchMethodError was thrown building:
  flutter: Class 'DataSnapshot' has no instance method '[]'.
  flutter: Receiver: Instance of 'DataSnapshot'
  </code></pre>
  
  <p>I guess it's index related. No idea how to correctly map it within a list. </p>
  
  <pre><code>import 'package:cached_network_image/cached_network_image.dart';
  import 'package:firebase_database/firebase_database.dart';
  import 'package:flutter/material.dart';
  
  class Test extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new Container(
          alignment: Alignment.center,
          padding: const EdgeInsets.all(16.0),
          child: new FutureBuilder(
              future: FirebaseDatabase.instance
                  .reference()
                  .child('messages')
                  .child('1551276762582')
                  .orderByChild('messagetype')
                  .equalTo('1')
                  .once(),
              builder: (BuildContext context, AsyncSnapshot snapshot) {
                if (snapshot.hasData) {
                  if (snapshot.data != null) {
                    return new Column(
                      children: &lt;Widget&gt;[
                        new Expanded(
                          child: new GridView.builder(
                            // itemCount: item.length,
                            gridDelegate:
                                new SliverGridDelegateWithFixedCrossAxisCount(
                                    crossAxisCount: 2),
                            itemBuilder: (context, index) {
                              return GridTile(
                                  child: CachedNetworkImage(
                                      imageUrl: snapshot.data[index]['imageUrl']
                                          .toString()));
                            },
                          ),
                        )
                      ],
                    );
                  } else {
                    return new CircularProgressIndicator();
                  }
                } else {
                  return new CircularProgressIndicator();
                }
              }));
    }
  }
  </code></pre>