0PricingLogin
Dart Academy · Lesson

Transforming Streams: map, where, take

Reshape an event sequence.

Streams Are Transformable

Just like lists, streams have handy methods that reshape their events. You can transform a stream into a new one without touching the source.

map Transforms Each Event

The map method runs a function on every event and emits the result. It turns one stream of values into a stream of transformed values.

final doubled = numbers.map((n) => n * 2);

All lessons in this course

  1. Listening With await for
  2. Single vs Broadcast Streams
  3. Transforming Streams: map, where, take
  4. Creating Streams With async*
← Back to Dart Academy