Created
January 2, 2020 12:09
-
-
Save ashishrawat2911/551fbc2ec2fa1b35951673481470dae3 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
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