What is the difference between Sink and Stream in Flutter?

后端 未结 4 679
栀梦
栀梦 2021-02-03 23:50

The Google I/O 2018 video about Flutter explains how to use Dart streams to manage state in a Flutter application. The speaker talked about using Sink as input stre

4条回答
  •  無奈伤痛
    2021-02-04 00:14

    A StreamSink is a StreamConsumer, which means it can take several streams (added by addStream) and processes the events these streams emit.

    If it is the StreamSink of a StreamController then all events from the added streams are emitted by the stream created by the StreamController.

    This way you can pipe (forward) one or more streams into another one.

提交回复
热议问题