title: Flutter Firebase How to get random document
body: <p>I am trying to get some random posts from Firebase. But i am unable to get random document id.</p>
  <p>Is there any way to retrieve data from Firebase like this :-</p>
  <pre><code>  getRandomData() async {
  QuerySnapshot snapshot = await posts
      .document(random.id)
      .collection('userPosts')
      .getDocuments();}
  </code></pre>
  <h2><a href="https://i.stack.imgur.com/0ASIO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0ASIO.png" alt="" /></a></h2>
  <p>i am trying to say that. Now i am able to get documentID normally not in italics.so now how can i get random documentID from Firebase.</p>
  <p><a href="https://i.stack.imgur.com/Z3UW4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z3UW4.png" alt="enter image description here" /></a></p>