TransformingFunction<I, O> class
abstract
Transforming operation that produces at least one value for each original value.
class StringTransforming extends TransformingFunction<int, String> {
@override
Iterable<String> onValue(int value) sync* {
yield value.toString();
}
}
void main() async {
final Stream<int> stream = Stream
.fromIterable([1, 7, 2, 5])
.transform(StringTransforming());
final List<String> values = await stream.toList();
print(values); // ["1", "7", "2", "5"]
}
- Inheritance
-
- Object
- StreamTransformerBase<
I, O> - TransformingFunction
- Implementers
Constructors
- TransformingFunction()
-
TransformingFunction.parameter(Iterable<
O> onValue(I)) -
factory
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< I> stream) → Stream<O> -
Transforms the provided
stream
.override -
cast<
RS, RT> () → StreamTransformer< RS, RT> -
Provides a
StreamTransformer<RS, RT>
view of this stream transformer.inherited -
dispose(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onValue(
I value) → Iterable< O> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited