Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:async
  3. Stream<T>
  4. transform<S> method
transform
description

transform<S> method

Stream<S>transform<S>(
  1. StreamTransformer<T,S>streamTransformer
)

AppliesstreamTransformer to this stream.

Returns the transformed stream,that is, the result ofstreamTransformer.bind(this).This method simply allows writing the call tostreamTransformer.bindin a chained fashion, like

stream.map(mapping).transform(transformation).toList()

which can be more convenient than callingbind directly.

ThestreamTransformer can return any stream.Whether the returned stream is a broadcast stream or not,and which elements it will contain,is entirely up to the transformation.

This method should always be used for transformations which treatthe entire stream as representing a single valuewhich has perhaps been split into several parts for transport,like a file being read from disk or being fetched over a network.The transformation will then produce a new stream whichtransforms the stream's value incrementally (perhaps usingConverter.startChunkedConversion). The resulting streammay again be chunks of the result, but does not have tocorrespond to specific events from the source string.

Implementation

Stream<S> transform<S>(StreamTransformer<T, S> streamTransformer) {  return streamTransformer.bind(this);}
  1. Dart
  2. dart:async
  3. Stream<T>
  4. transform<S> method
Stream class

[8]ページ先頭

©2009-2025 Movatter.jp