Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Created January 2, 2020 12:09
Show Gist options
  • Save ashishrawat2911/551fbc2ec2fa1b35951673481470dae3 to your computer and use it in GitHub Desktop.
Save ashishrawat2911/551fbc2ec2fa1b35951673481470dae3 to your computer and use it in GitHub Desktop.
class MovieListBloc {
List<DocumentSnapshot> documentList;
BehaviorSubject<List<DocumentSnapshot>> movieController;
MovieListBloc() {
movieController = BehaviorSubject<List<DocumentSnapshot>>();
}
Stream<List<DocumentSnapshot>> get movieStream => movieController.stream;
/*This method will automatically fetch first 10 elements from the document list */
Future fetchFirstList() async {...}
/*This will automatically fetch the next 10 elements from the list*/
fetchNextMovies() async {...}
void dispose() {
movieController.close();
showIndicatorController.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment