GroupByStreamTransformer<T, K> class Null safety

The GroupBy operator divides a Stream that emits items into a Stream that emits GroupedStream, each one of which emits some subset of the items from the original source Stream.

GroupedStream acts like a regular Stream, yet adding a 'key' property, which receives its Type and value from the _grouper Function.

All items with the same key are emitted by the same GroupedStream.

Inheritance

Constructors

GroupByStreamTransformer(K grouper(T event), {Stream<void> durationSelector(GroupedStream<T, K> grouped)?})
Constructs a StreamTransformer which groups events from the source Stream and emits them as GroupedStream.

Properties

durationSelector → (Stream<void> Function?(GroupedStream<T, K> grouped)?)
A function that returns an Stream to determine how long each group should exist. When the returned Stream emits its first data or done event, the group will be closed and removed.
final
grouper → K Function(T event)
Method which converts incoming events into a new GroupedStream
final
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

bind(Stream<T> stream) Stream<GroupedStream<T, K>>
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 non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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