Bad state: You cannot close the subject while items are being added from addStream in flutter

后端 未结 2 1879
栀梦
栀梦 2021-01-05 00:41

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

2条回答
  •  轮回少年
    2021-01-05 01:39

    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

提交回复
热议问题