concatWith method

Stream<T> concatWith (
  1. Iterable<Stream<T>> other
)

Returns a Stream that emits all items from the current Stream, then emits all items from the given streams, one after the next.

Example

TimerStream(1, Duration(seconds: 10))
    .concatWith([Stream.fromIterable([2])])
    .listen(print); // prints 1, 2

Implementation

Stream<T> concatWith(Iterable<Stream<T>> other) =>
    transform(StreamTransformer.fromBind(
        (stream) => ConcatStream<T>([stream, ...other])));