Movatterモバイル変換


[0]ホーム

URL:


menu
  1. async package
  2. documentation
  3. async.dart
  4. SubscriptionStream<T> class
SubscriptionStream<T> class

SubscriptionStream<T> class

AStream adapter for aStreamSubscription.

This class allows aStreamSubscription to be treated as aStream.

The subscription is paused until the stream is listened to,then it is resumed and the events are passed on to thestream's new subscription.

This class assumes that it has control over the original subscription.If other code is accessing the subscription, results may be unpredictable.

Inheritance
Available extensions

Constructors

SubscriptionStream(StreamSubscription<T>subscription)
Create a single-subscriptionStream fromsubscription.

Properties

firstFuture<T>
The first element of this stream.
no setterinherited
firstOrNullFuture<T?>

Available onStream<T>, provided by theStreamExtensions extension

A future which completes with the first event of this stream, or withnull.
no setter
hashCodeint
The hash code for this object.
no setterinherited
isBroadcastbool
Whether this stream is a broadcast stream.
no setterinherited
isEmptyFuture<bool>
Whether this stream contains any elements.
no setterinherited
lastFuture<T>
The last element of this stream.
no setterinherited
lengthFuture<int>
The number of elements in this stream.
no setterinherited
runtimeTypeType
A representation of the runtime type of the object.
no setterinherited
singleFuture<T>
The single element of this stream.
no setterinherited

Methods

any(booltest(Telement))Future<bool>
Checks whethertest accepts any element provided by this stream.
inherited
asBroadcastStream({voidonListen(StreamSubscription<T>subscription)?,voidonCancel(StreamSubscription<T>subscription)?})Stream<T>
Returns a multi-subscription stream that produces the same events as this.
inherited
asyncExpand<E>(Stream<E>?convert(Tevent))Stream<E>
Transforms each element into a sequence of asynchronous events.
inherited
asyncMap<E>(FutureOr<E>convert(Tevent))Stream<E>
Creates a new stream with each data event of this stream asynchronouslymapped to a new event.
inherited
cast<R>()Stream<R>
Adapt this stream to be aStream<R>.
inherited
contains(Object?needle)Future<bool>
Returns whetherneedle occurs in the elements provided by this stream.
inherited
distinct([boolequals(Tprevious,Tnext)?])Stream<T>
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 erroroccurred.
inherited
elementAt(intindex)Future<T>
Returns the value of theindexth data event of this stream.
inherited
every(booltest(Telement))Future<bool>
Checks whethertest accepts all elements provided by this stream.
inherited
expand<S>(Iterable<S>convert(Telement))Stream<S>
Transforms each element of this stream into a sequence of elements.
inherited
firstWhere(booltest(Telement), {TorElse()?})Future<T>
Finds the first element of this stream matchingtest.
inherited
fold<S>(SinitialValue,Scombine(Sprevious,Telement))Future<S>
Combines a sequence of values by repeatedly applyingcombine.
inherited
forEach(voidaction(Telement))Future<void>
Executesaction on each element of this stream.
inherited
handleError(FunctiononError, {booltest(dynamicerror)?})Stream<T>
Creates a wrapper Stream that intercepts some errors from this stream.
inherited
join([Stringseparator =""])Future<String>
Combines the string representation of elements into a single string.
inherited
lastWhere(booltest(Telement), {TorElse()?})Future<T>
Finds the last element in this stream matchingtest.
inherited
listen(voidonData(T)?, {Function?onError,voidonDone()?,bool?cancelOnError})StreamSubscription<T>
Adds a subscription to this stream.
override
listenAndBuffer()Stream<T>

Available onStream<T>, provided by theStreamExtensions extension

Eagerly listens to this stream and buffers events until needed.
map<S>(Sconvert(Tevent))Stream<S>
Transforms each element of this stream into a new stream event.
inherited
noSuchMethod(Invocationinvocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pipe(StreamConsumer<T>streamConsumer)Future
Pipes the events of this stream intostreamConsumer.
inherited
reduce(Tcombine(Tprevious,Telement))Future<T>
Combines a sequence of values by repeatedly applyingcombine.
inherited
singleWhere(booltest(Telement), {TorElse()?})Future<T>
Finds the single element in this stream matchingtest.
inherited
skip(intcount)Stream<T>
Skips the firstcount data events from this stream.
inherited
skipWhile(booltest(Telement))Stream<T>
Skip data events from this stream while they are matched bytest.
inherited
slices(intlength)Stream<List<T>>

Available onStream<T>, provided by theStreamExtensions extension

Creates a stream whose elements are contiguous slices ofthis.
take(intcount)Stream<T>
Provides at most the firstcount data events of this stream.
inherited
takeWhile(booltest(Telement))Stream<T>
Forwards data events whiletest is successful.
inherited
timeout(DurationtimeLimit, {voidonTimeout(EventSink<T>sink)?})Stream<T>
Creates a new stream with the same events as this stream.
inherited
toList()Future<List<T>>
Collects all elements of this stream in aList.
inherited
toSet()Future<Set<T>>
Collects the data of this stream in aSet.
inherited
toString()String
A string representation of this object.
inherited
transform<S>(StreamTransformer<T,S>streamTransformer)Stream<S>
AppliesstreamTransformer to this stream.
inherited
where(booltest(Tevent))Stream<T>
Creates a new stream from this stream that discards some elements.
inherited

Operators

operator ==(Objectother)bool
The equality operator.
inherited
  1. async package
  2. documentation
  3. async
  4. SubscriptionStream<T> class
async library

[8]ページ先頭

©2009-2026 Movatter.jp