DematerializeStreamTransformer<S> class
Converts the onData, onDone, and onError Notification
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 Notification
objects. Dematerialize simply reverses this by
transforming Notification
objects back to a normal stream of events.
Example
Stream<Notification<int>>
.fromIterable([Notification.onData(1), Notification.onDone()])
.transform(DematerializeStreamTransformer())
.listen((i) => print(i)); // Prints 1
Error example
Stream<Notification<int>>
.fromIterable([Notification.onError(Exception(), null)])
.transform(DematerializeStreamTransformer())
.listen(null, onError: (e, s) { print(e) }); // Prints Exception
- Inheritance
-
- Object
- StreamTransformerBase<
Notification< S> , S> - DematerializeStreamTransformer
Constructors
- DematerializeStreamTransformer()
-
Constructs a StreamTransformer which converts the onData, onDone, and
onError
Notification
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< Notification< stream) → Stream<S> >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