Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Created January 2, 2020 12:06
Show Gist options
  • Save ashishrawat2911/2e5ae1a0dfd1a8b91e40bd3eff96fb7c to your computer and use it in GitHub Desktop.
Save ashishrawat2911/2e5ae1a0dfd1a8b91e40bd3eff96fb7c to your computer and use it in GitHub Desktop.
List<DocumentSnapshot> documentList;
fetchNextMovies() async {
try {
updateIndicator(true);
List<DocumentSnapshot> newDocumentList = (await Firestore.instance
.collection("movies")
.orderBy("rank")
.startAfterDocument(documentList[documentList.length - 1])
.limit(10)
.getDocuments())
.documents;
documentList.addAll(newDocumentList);
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