MapNotNullStreamTransformer<T, R extends Object> class

Create a Stream containing only the non-null results of applying the given transform function to each element of the Stream.

Example

Stream.fromIterable(['1', 'two', '3', 'four'])
  .transform(MapNotNullStreamTransformer(int.tryParse))
  .listen(print); // prints 1, 3

// equivalent to:

Stream.fromIterable(['1', 'two', '3', 'four'])
  .map(int.tryParse)
  .transform(WhereTypeStreamTransformer<int?, int>())
  .listen(print); // prints 1, 3
Inheritance

Constructors

MapNotNullStreamTransformer(R? transform(T))
Constructs a StreamTransformer which emits non-null elements of applying the given transform function to each element of the Stream.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transform → R? Function(T)
A function that transforms each elements of the Stream.
final

Methods

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

Operators

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