By reading @abin's answer in What is the difference between Sink and Stream in Flutter?, I have understood the relation btw Sink
and Stream
. Other than that, What are the relationships btw BehaviorSubject
, BehaviorSubject.add
, StreamController
, BehaviorSubject.stream
or maybe with Sink
? I have no idea if there are any relationships btw BehaviorSubject
and Sink
. Maybe these two have no relationship at all? In the Google I/O 2018 video, it basically just uses BehaviorSubject.add
and BehaviorSubject.stream
for the output. Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
StreamController has a Stream and a Sink
BehaviorSubject is a type of StreamController that can remember the last value added to its sink
BehaviorSubject is a class from RxDart a member of reactive libraries implemented for Dart language.
Sink is where you dump your object into Stream.
hope that help you :)