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.
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.dart.dev/stable/2.5.0/dart-async/Stream/castFrom.html