It’s easy to get collection data in Firebase. Just use the get() function with your collection name. Let’s take a look at the code below
var myData = FirebaseFirestore.instance.get("message").get();
Here we need to use FirebaseFirestore.instance to get a reference of the Firestore instance. Then we mention the collection name.
With the collection name we use the get() function. get() will return all the data from Firestore as documents.