Created
January 2, 2020 12:06
-
-
Save ashishrawat2911/2e5ae1a0dfd1a8b91e40bd3eff96fb7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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