Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Last active March 21, 2020 14:50
Show Gist options
  • Select an option

  • Save ashishrawat2911/3514d4f1065adcaecb8c9bf8223320e3 to your computer and use it in GitHub Desktop.

Select an option

Save ashishrawat2911/3514d4f1065adcaecb8c9bf8223320e3 to your computer and use it in GitHub Desktop.
List<DocumentSnapshot> documentList;
Future fetchFirstList() async {
try {
documentList = (await Firestore.instance
.collection("movies")
.orderBy("rank")
.limit(10)
.getDocuments())
.documents;
print(documentList);
movieController.sink.add(documentList);
} on SocketException {
movieController.sink.addError(SocketException("No Internet Connection"));
} catch (e) {
print(e.toString());
movieController.sink.addError(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment