TransformingUnaryOperator<T> class abstract

Transforming operation that produces at least one value as the same type as the original value.

class PlusOneTransforming extends TransformingUnaryOperator<int> {
  @override
  Iterable<int> onValue(int value) sync* {
    yield value;
    yield value + 1;
  }
}

void main() async {
  final Stream<int> stream = Stream
    .fromIterable([1, 7, 2, 5])
    .transform(PlusOneTransforming());

  final List<String> values = await stream.toList();
  print(values);   // [1, 2, 7, 8, 2, 3, 5, 6]
}
Inheritance
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(Stream<T> stream) Stream<T>
Transforms the provided stream.
inherited
cast<RS, RT>() StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
dispose() Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onValue(T value) Iterable<T>
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited