I have two streams, Stream<A>
and Stream<B>
. I have a constructor for a type C
that takes an A
and a B
. How do I merge the two Stream
s into a Stream<C>
?
相关问题
- What means in Dart static type and why it differs
- Flutter : Prepare list data from http request
- How to schedule an alarm on specific time in Flutt
- MappedListIterable is not a SubType
- What is the difference between generics and dynami
相关文章
- Observatory server failed to start - Fails to crea
- Adding Shadows at the bottom of a container in flu
- Flutter. Check if a file exists before loading it
- Receive share file intents with Flutter
- Do stateless widgets dispose on their own?
- how to implement Alphabet scroll in flutter
- Flutter: Is it possible to format (bold, italicize
- Make Function parameter optional in custom widget
You can use
StreamZip
inpackage:async
to combine two streams into one stream of pairs, then create theC
objects from that.See also http://news.dartlang.org/2016/03/unboxing-packages-async-part-2.html
prints
If you need to react when either
Stream<A>
orStream<B>
emits an event and use the latest value from both streams, usecombineLatest
.