Atri Das
1 min readSep 15, 2020

--

you can do like this.

final CollectionReference yourCollection =

Firestore.instance.collection('CollectionName');

Stream<List<YourModel>> getFunctoinName() {

return yourCollection.orderBy('uniqueIndex',descending: true)

.snapshots().map((snapShot) => snapShot.documents

.map((document) => YourModel.fromMap(document.data))

.toList());

}

--

--

Atri Das
Atri Das

Written by Atri Das

Developer Student Clubs Alumni by Google Developers || Flutter Developer and Explorer

No responses yet