title: How to listen for document changes in Cloud Firestore using Flutter?
body: <p>I would like to have a listener method that checks for changes to a collection of documents if changes occur.</p>
  
  <p>Something like: </p>
  
  <pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
  
  
    Future&lt;Null&gt; checkFocChanges() async {
      Firestore.instance.runTransaction((Transaction tx) async {
        CollectionReference reference = Firestore.instance.collection('planets');
        reference.onSnapshot.listen((querySnapshot) {
          querySnapshot.docChanges.forEach((change) {
            // Do something with change
          });
        });
      });
    }
  </code></pre>
  
  <p>The error here is that <code>onSnapshot</code> isn't defined on <code>CollectionReference</code>.</p>
  
  <p>Any ideas?</p>