Transforms a Stream.
When a stream's Stream.transform method is invoked with a StreamTransformer, the stream calls the bind method on the provided transformer. The resulting stream is then returned from the Stream.transform method.
Conceptually, a transformer is simply a function from Stream to Stream that is encapsulated into a class.
It is good practice to write transformers that can be used multiple times.
All other transforming methods on Stream, such as Stream.map, Stream.where or Stream.expand can be implemented using Stream.transform. A StreamTransformer is thus very powerful but often also a bit more complicated to use.
onListen
callback. [...] stream
. [...] StreamTrasformer<RS, RT>
view of this stream transformer. [...] source
to be a StreamTransfomer<TS, TT>
. [...]
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-async/StreamTransformer-class.html