Controller<T, S> class abstract

Inheritance
Mixed-in types
Available extensions

Constructors

Controller.new(S value, {List<LogConfig<T>>? inputLogs, List<LogConfig<S>>? outputLogs})

Properties

done Future<void>
Return a future which is completed when the StreamSink is finished.
no setterinherited
first Future<S>
The first element of this stream.
no setterinherited
firstOrNull Future<T?>

Available on Stream<T>, provided by the StreamExtensions extension

A future which completes with the first event of this stream, or with null.
no setter
hashCode int
The hash code for this object.
no setterinherited
inputCount int
getter/setter pairinherited
inputCounts Stream<int>
no setterinherited
inputStream StreamController<T>
finalinherited
isBroadcast bool
Whether this stream is a broadcast stream.
no setterinherited
isEmpty Future<bool>
Whether this stream contains any elements.
no setterinherited
last Future<S>
The last element of this stream.
no setterinherited
length Future<int>
The number of elements in this stream.
no setterinherited
output Stream<S>
no setterinherited
outputCount int
getter/setter pairinherited
outputCounts Stream<int>
no setterinherited
outputStream StreamController<S>
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single Future<S>
The single element of this stream.
no setterinherited
subs List<StreamSubscription>
finalinherited
value ↔ S
getter/setter pairoverride

Methods

add(T event) → void
Adds a data event to the sink.
inherited
addError(Object error, [StackTrace? stackTrace]) → void
Adds an error to the sink.
inherited
addStream(Stream<T> stream) Future<void>
Consumes the elements of stream.
inherited
any(bool test(S element)) Future<bool>
Checks whether test accepts any element provided by this stream.
inherited
asAggragate() Aggragate<K, V>

Available on Stream<MapEntry<K, V>>, provided by the AggregateExtension extension

asBroadcastStream({void onListen(StreamSubscription<S> subscription)?, void onCancel(StreamSubscription<S> subscription)?}) Stream<S>
Returns a multi-subscription stream that produces the same events as this.
inherited
asGroupBy(Stream<int> builder(V e)) Stream<GroupBy<int, V>>

Available on Stream<List<V>>, provided by the GroupByListsExtension extension

asMerge() Merge<T>

Available on Stream<T>, provided by the MergeExtension extension

asPipe() Pipe<T>

Available on Stream<T>, provided by the PipeExtension extension

asSnapshot() Snapshot<T>

Available on Stream<T>, provided by the SnapshotExtension extension

asyncExpand<E>(Stream<E>? convert(S event)) Stream<E>
Transforms each element into a sequence of asynchronous events.
inherited
asyncMap<E>(FutureOr<E> convert(S event)) Stream<E>
Creates a new stream with each data event of this stream asynchronously mapped to a new event.
inherited
asyncMapBuffer<S>(Future<S> convert(List<T>)) Stream<S>

Available on Stream<T>, provided by the AsyncMap extension

Like asyncMap but events are buffered until previous events have been processed by convert.
asyncMapSample<S>(Future<S> convert(T)) Stream<S>

Available on Stream<T>, provided by the AsyncMap extension

Like asyncMap but events are discarded while work is happening in convert.
asyncWhere(FutureOr<bool> test(T)) Stream<T>

Available on Stream<T>, provided by the Where extension

Discards events from this stream based on an asynchronous test callback.
audit(Duration duration) Stream<T>

Available on Stream<T>, provided by the RateLimit extension

Audit a single event from each duration length period where there are events on this stream.
buffer(Stream<void> trigger, {bool longPoll = true}) Stream<List<T>>

Available on Stream<T>, provided by the RateLimit extension

Buffers the values emitted on this stream and emits them when trigger emits an event.
cast<R>() Stream<R>
Adapt this stream to be a Stream<R>.
inherited
close() Future<void>
Tells the stream sink that no further streams will be added.
inherited
combineLatest<T2, S>(Stream<T2> other, FutureOr<S> combine(T, T2)) Stream<S>

Available on Stream<T>, provided by the CombineLatest extension

Combines the latest values from this stream with the latest values from other using combine.
combineLatestAll(Iterable<Stream<T>> others) Stream<List<T>>

Available on Stream<T>, provided by the CombineLatest extension

Combine the latest value emitted from the source stream with the latest values emitted from others.
concurrentAsyncExpand<S>(Stream<S> convert(T)) Stream<S>

Available on Stream<T>, provided by the AsyncExpand extension

Like asyncExpand but the convert callback may be called for an element before the Stream emitted by the previous element has closed.
concurrentAsyncMap<S>(FutureOr<S> convert(T)) Stream<S>

Available on Stream<T>, provided by the AsyncMap extension

Like asyncMap but the convert callback may be called for an element before processing for the previous element is finished.
contains(Object? needle) Future<bool>
Returns whether needle occurs in the elements provided by this stream.
inherited
debounce(Duration duration, {bool leading = false, bool trailing = true}) Stream<T>

Available on Stream<T>, provided by the RateLimit extension

Suppresses events with less inter-event spacing than duration.
debounceBuffer(Duration duration) Stream<List<T>>

Available on Stream<T>, provided by the RateLimit extension

Buffers values until this stream does not emit for duration then emits the collected values.
dispose() → void
override
disposeProcessor() → void
inherited
disposeState() → void
inherited
distinct([bool equals(S previous, S next)?]) Stream<S>
Skips data events if they are equal to the previous data event.
inherited
drain<E>([E? futureValue]) Future<E>
Discards all data on this stream, but signals when it is done or an error occurred.
inherited
elementAt(int index) Future<S>
Returns the value of the indexth data event of this stream.
inherited
every(bool test(S element)) Future<bool>
Checks whether test accepts all elements provided by this stream.
inherited
expand<S>(Iterable<S> convert(S element)) Stream<S>
Transforms each element of this stream into a sequence of elements.
inherited
firstWhere(bool test(S element), {S orElse()?}) Future<S>
Finds the first element of this stream matching test.
inherited
fold<S>(S initialValue, S combine(S previous, S element)) Future<S>
Combines a sequence of values by repeatedly applying combine.
inherited
followedBy(Stream<T> next) Stream<T>

Available on Stream<T>, provided by the Concatenate extension

Emits all values and errors from next following all values and errors from this stream.
forEach(void action(S element)) Future<void>
Executes action on each element of this stream.
inherited
handleError(Function onError, {bool test(dynamic error)?}) Stream<S>
Creates a wrapper Stream that intercepts some errors from this stream.
inherited
initDisposable() → void
inherited
initInputCounter() → void
inherited
initOutputCounter() → void
inherited
initProcessor() DuplexSubscription<T, S>
inherited
initState() StreamSubscription<S>
inherited
initWaiter(StreamSubscription sub) → void
inherited
inputLogger(LogConfig<T> config) → void
inherited
join([String separator = ""]) Future<String>
Combines the string representation of elements into a single string.
inherited
lastWhere(bool test(S element), {S orElse()?}) Future<S>
Finds the last element in this stream matching test.
inherited
listen(void onData(S event)?, {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription<S>
Adds a subscription to this stream.
inherited
listenAndBuffer() Stream<T>

Available on Stream<T>, provided by the StreamExtensions extension

Eagerly listens to this stream and buffers events until needed.
map<S>(S convert(S event)) Stream<S>
Transforms each element of this stream into a new stream event.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTask(T task) Stream<S>
outputLogger(LogConfig<S> config) → void
inherited
pipe(StreamConsumer<S> streamConsumer) Future
Pipes the events of this stream into streamConsumer.
inherited
processor(Stream<T> input) Stream<S>
override
reduce(S combine(S previous, S element)) Future<S>
Combines a sequence of values by repeatedly applying combine.
inherited
rejectErrors() StreamSink<T>

Available on StreamSink<T>, provided by the StreamSinkExtensions extension

Returns a StreamSink that forwards to this but rejects errors.
sample(Stream<void> trigger, {bool longPoll = true}) Stream<T>

Available on Stream<T>, provided by the RateLimit extension

Emits the most recent new value from this stream when trigger emits an event.
scan<S>(S initialValue, FutureOr<S> combine(S soFar, T element)) Stream<S>

Available on Stream<T>, provided by the Scan extension

Emits a sequence of the accumulated values from repeatedly applying combine.
singleWhere(bool test(S element), {S orElse()?}) Future<S>
Finds the single element in this stream matching test.
inherited
skip(int count) Stream<S>
Skips the first count data events from this stream.
inherited
skipWhile(bool test(S element)) Stream<S>
Skip data events from this stream while they are matched by test.
inherited
slices(int length) Stream<List<T>>

Available on Stream<T>, provided by the StreamExtensions extension

Creates a stream whose elements are contiguous slices of this.
startWith(T initial) Stream<T>

Available on Stream<T>, provided by the Concatenate extension

Emits initial before any values or errors from the this stream.
startWithMany(Iterable<T> initial) Stream<T>

Available on Stream<T>, provided by the Concatenate extension

Emits all values in initial before any values or errors from this stream.
startWithStream(Stream<T> initial) Stream<T>

Available on Stream<T>, provided by the Concatenate extension

Emits all values and errors in initial before any values or errors from this stream.
switchLatest() Stream<T>

Available on Stream<Stream<T>>, provided by the SwitchLatest extension

Emits values from the most recently emitted Stream.
switchMap<S>(Stream<S> convert(T)) Stream<S>

Available on Stream<T>, provided by the Switch extension

Maps events to a Stream and emits values from the most recently created Stream.
take(int count) Stream<S>
Provides at most the first count data events of this stream.
inherited
takeUntil(Future<void> trigger) Stream<T>

Available on Stream<T>, provided by the TakeUntil extension

Takes values from this stream which are emitted before trigger completes.
takeWhile(bool test(S element)) Stream<S>
Forwards data events while test is successful.
inherited
tap(void onValue(T)?, {void onError(Object, StackTrace)?, void onDone()?}) Stream<T>

Available on Stream<T>, provided by the Tap extension

Taps into this stream to allow additional handling on a single-subscriber stream without first wrapping as a broadcast stream.
throttle(Duration duration, {bool trailing = false}) Stream<T>

Available on Stream<T>, provided by the RateLimit extension

Reduces the rate that events are emitted to at most once per duration.
timeout(Duration timeLimit, {void onTimeout(EventSink<S> sink)?}) Stream<S>
Creates a new stream with the same events as this stream.
inherited
toList() Future<List<S>>
Collects all elements of this stream in a List.
inherited
toSet() Future<Set<S>>
Collects the data of this stream in a Set.
inherited
toString() String
A string representation of this object.
inherited
transform<S>(StreamTransformer<S, S> streamTransformer) Stream<S>
Applies streamTransformer to this stream.
inherited
transform<S>(StreamSinkTransformer<S, T> transformer) StreamSink<S>

Available on StreamSink<T>, provided by the StreamSinkExtensions extension

Transforms a StreamSink using transformer.
waitFor(Future<void> task) → void
inherited
where(bool test(S event)) Stream<S>
Creates a new stream from this stream that discards some elements.
inherited
whereNotNull() Stream<T>

Available on Stream<T?>, provided by the WhereNotNull extension

Discards null events from this stream.
whereType<S>() Stream<S>

Available on Stream<T>, provided by the Where extension

Discards events from this stream that are not of type S.

Operators

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