Controller<T, S> class
abstract
- Inheritance
- Mixed-in types
-
- Input<
T> - Output<
S> - Disposable<
T> - Processor<
T, S> - StateValue<
T, S> - InputLogger<
T> - OutputLogger<
S> - Waiter
- InputCounter<
T> - OutputCounter<
S>
- Input<
- Available extensions
Constructors
-
Controller.new(S value, {List<
LogConfig< ? inputLogs, List<T> >LogConfig< ? outputLogs})S> >
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<
A future which completes with the first event of this stream, or withT> , provided by the StreamExtensions extensionnull
.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< , provided by the AggregateExtension extensionK, V> > -
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< , provided by the GroupByListsExtension extensionV> > -
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<
Like asyncMap but events are buffered until previous events have been processed byT> , provided by the AsyncMap extensionconvert
. -
asyncMapSample<
S> (Future< S> convert(T)) → Stream<S> -
Available on Stream<
Like asyncMap but events are discarded while work is happening inT> , provided by the AsyncMap extensionconvert
. -
asyncWhere(
FutureOr< bool> test(T)) → Stream<T> -
Available on Stream<
Discards events from this stream based on an asynchronousT> , provided by the Where extensiontest
callback. -
audit(
Duration duration) → Stream< T> -
Available on Stream<
Audit a single event from eachT> , provided by the RateLimit extensionduration
length period where there are events on this stream. -
buffer(
Stream< void> trigger, {bool longPoll = true}) → Stream<List< T> > -
Available on Stream<
Buffers the values emitted on this stream and emits them whenT> , provided by the RateLimit extensiontrigger
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<
Combines the latest values from this stream with the latest values fromT> , provided by the CombineLatest extensionother
usingcombine
. -
combineLatestAll(
Iterable< Stream< others) → Stream<T> >List< T> > -
Available on Stream<
Combine the latest value emitted from the source stream with the latest values emitted fromT> , provided by the CombineLatest extensionothers
. -
concurrentAsyncExpand<
S> (Stream< S> convert(T)) → Stream<S> -
Available on Stream<
Like asyncExpand but theT> , provided by the AsyncExpand extensionconvert
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<
Like asyncMap but theT> , provided by the AsyncMap extensionconvert
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<
Suppresses events with less inter-event spacing thanT> , provided by the RateLimit extensionduration
. -
debounceBuffer(
Duration duration) → Stream< List< T> > -
Available on Stream<
Buffers values until this stream does not emit forT> , provided by the RateLimit extensionduration
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
index
th 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<
Emits all values and errors fromT> , provided by the Concatenate extensionnext
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<
Eagerly listens to this stream and buffers events until needed.T> , provided by the StreamExtensions extension -
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<
Returns a StreamSink that forwards toT> , provided by the StreamSinkExtensions extensionthis
but rejects errors. -
sample(
Stream< void> trigger, {bool longPoll = true}) → Stream<T> -
Available on Stream<
Emits the most recent new value from this stream whenT> , provided by the RateLimit extensiontrigger
emits an event. -
scan<
S> (S initialValue, FutureOr< S> combine(S soFar, T element)) → Stream<S> -
Available on Stream<
Emits a sequence of the accumulated values from repeatedly applyingT> , provided by the Scan extensioncombine
. -
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<
Creates a stream whose elements are contiguous slices ofT> , provided by the StreamExtensions extensionthis
. -
startWith(
T initial) → Stream< T> -
Available on Stream<
EmitsT> , provided by the Concatenate extensioninitial
before any values or errors from the this stream. -
startWithMany(
Iterable< T> initial) → Stream<T> -
Available on Stream<
Emits all values inT> , provided by the Concatenate extensioninitial
before any values or errors from this stream. -
startWithStream(
Stream< T> initial) → Stream<T> -
Available on Stream<
Emits all values and errors inT> , provided by the Concatenate extensioninitial
before any values or errors from this stream. -
switchLatest(
) → Stream< T> -
Available on Stream<
Emits values from the most recently emitted Stream.Stream< , provided by the SwitchLatest extensionT> > -
switchMap<
S> (Stream< S> convert(T)) → Stream<S> - 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<
Takes values from this stream which are emitted beforeT> , provided by the TakeUntil extensiontrigger
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> - 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<
Reduces the rate that events are emitted to at most once perT> , provided by the RateLimit extensionduration
. -
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<
Transforms a StreamSink usingT> , provided by the StreamSinkExtensions extensiontransformer
. -
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<
DiscardsT?> , provided by the WhereNotNull extensionnull
events from this stream. -
whereType<
S> () → Stream< S> -
Available on Stream<
Discards events from this stream that are not of typeT> , provided by the Where extensionS
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited