W3cubDocs

/Dart 2

castFrom<S, T> method

Stream<T> castFrom <S, T>(Stream<S> source)

Adapts source to be a Stream<T>.

This allows source to be used at the new type, but at run-time it must satisfy the requirements of both the new type and its original type.

Data events created by the source stream must also be instances of T.

Implementation

static Stream<T> castFrom<S, T>(Stream<S> source) =>
    new CastStream<S, T>(source);

© 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/Stream/castFrom.html