DematerializeStreamTransformer<S> class

Converts the onData, onDone, and onError StreamNotification objects from a materialized stream into normal onData, onDone, and onError events.

When a stream has been materialized, it emits onData, onDone, and onError events as StreamNotification objects. Dematerialize simply reverses this by transforming StreamNotification objects back to a normal stream of events.

Example

Stream<StreamNotification<int>>
    .fromIterable([StreamNotification.data(1), StreamNotification.done()])
    .transform(DematerializeStreamTransformer())
    .listen(print); // Prints 1

Error example

Stream<StreamNotification<int>>
    .fromIterable([StreamNotification.error(Exception(), null)])
    .transform(DematerializeStreamTransformer())
    .listen(null, onError: (e, s) => print(e)); // Prints Exception
Inheritance

Constructors

DematerializeStreamTransformer()
Constructs a StreamTransformer which converts the onData, onDone, and onError StreamNotification objects from a materialized stream into normal onData, onDone, and onError events.

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<StreamNotification<S>> stream) Stream<S>
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