title: how to sort the data from firebase? inside a flutter app
body: <p>I have been trying to sort data which i get from firebase database below is the code I tried but this throws an error:</p>
  <blockquote>
  <p>(NoSuchMethodError: Class &quot;String&quot; has no instance method 'orderBy').</p>
  </blockquote>
  <p>What is the best practice to sort the data?</p>
  <pre><code>dateTime: snapshot.data.documents[index].data['dateTime'].orderBy('createdAt', descending: true),
  </code></pre>
  <p>Below I am adding the code from CrudMethods.</p>
  <pre><code>  getData() async {
      return await Firestore.instance.collection('PlasmaRequests').orderBy('createdAt', descending: true).snapshots();
    }
  </code></pre>