I am using RxDart to observe changes and update the UI accordingly. When the app launches I am making a network call and successfully getting the data, observe the changes a
You can also resolve it be replacing:
MovieDetailBloc() {
_movieId.stream.transform(_itemTransformer()).pipe(_trailers);
}
with
MovieDetailBloc() {
_movieId.stream.transform(_itemTransformer()).listen((data) {
if (!_categories.isClosed) {
_trailers.add(data);
}
});
}
I think draining the stream should fix the problem
dispose() async {
_movieId.close();
await _trailers.drain();
_trailers.close();
}
https://api.dartlang.org/stable/2.0.0/dart-async/Stream-class.html