Firestore.instance
.collection('collection_name')
.orderBy('field_name', descending: true)
.orderBy('field_name')
void initState() {
super.initState();
...
Firestore.instance
.collection('collection_name')
.document(_user.uid)
.collection('collection_name')
.orderBy('field_name', descending: true)
.orderBy('field_name')
.snapshots()
.listen((data) {
setState(() {
_localEvents.clear();
var datas = data?.documents ?? [];
...
}
}
}
https://firebase.google.com/docs/firestore/query-data/order-limit-data?hl=ko