async library Null safety

Utilities that expand on the asynchronous features of the dart:async library.

Classes

AsyncCache<T>
Runs asynchronous functions and caches the result for a period of time.
AsyncMemoizer<T>
A class for running an asynchronous function exactly once and caching its result.
CancelableCompleter<T>
A completer for a CancelableOperation.
CancelableOperation<T>
An asynchronous operation that can be cancelled.
ChunkedStreamReader<T>
Utility class for reading elements from a chunked stream.
DelegatingEventSink<T>
Simple delegating wrapper around an EventSink.
DelegatingFuture<T>
A wrapper that forwards calls to a Future.
DelegatingSink<T>
Simple delegating wrapper around a Sink.
DelegatingStream<T>
Simple delegating wrapper around a Stream.
DelegatingStreamConsumer<T>
Simple delegating wrapper around a StreamConsumer.
DelegatingStreamSink<T>
Simple delegating wrapper around a StreamSink.
DelegatingStreamSubscription<T>
Simple delegating wrapper around a StreamSubscription.
ErrorResult
A result representing a thrown error.
EventSinkBase<T>
An abstract class that implements EventSink in terms of onData, onError, and onClose methods.
FutureGroup<T>
A collection of futures waits until all added Futures complete.
IOSinkBase
An abstract class that implements dart:io's IOSink's API in terms of onData, onError, onClose, and onFlush methods.
LazyStream<T>
A Stream wrapper that forwards to another Stream that's initialized lazily.
NullStreamSink<T>
A StreamSink that discards all events.
RestartableTimer
A non-periodic timer that can be restarted any number of times.
Result<T>
The result of a computation.
ResultFuture<T>
A Future wrapper that provides synchronous access to the result of the wrapped Future once it's completed.
SingleSubscriptionTransformer<S, T>
A transformer that converts a broadcast stream into a single-subscription stream.
StreamCloser<T>
A StreamTransformer that allows the caller to forcibly close the transformed Stream.
StreamCompleter<T>
A single-subscription stream where the contents are provided later.
StreamGroup<T>
A collection of streams whose events are unified and sent through a central stream.
StreamQueue<T>
An asynchronous pull-based interface for accessing stream events.
StreamQueueTransaction<T>
A transaction on a StreamQueue, created by StreamQueue.startTransaction.
StreamSinkBase<T>
An abstract class that implements StreamSink in terms of onData, onError, and onClose methods.
StreamSinkCompleter<T>
A sink where the destination is provided later.
StreamSinkTransformer<S, T>
A StreamSinkTransformer transforms the events being passed to a sink.
StreamSplitter<T>
A class that splits a single source stream into an arbitrary number of (single-subscription) streams (called "branch") that emit the same events.
StreamZip<T>
A stream that combines the values of other streams.
SubscriptionStream<T>
A Stream adapter for a StreamSubscription.
ValueResult<T>
A result representing a returned value.

Extensions

ChunkedStreamReaderByteStreamExt
Extensions for using ChunkedStreamReader with byte-streams.
StreamExtensions
Utility extensions on Stream.
StreamSinkExtensions
Extensions on StreamSink to make stream transformations more fluent.

Functions

collectBytes(Stream<List<int>> source) Future<Uint8List>
Collects an asynchronous sequence of byte lists into a single list of bytes.
collectBytesCancelable(Stream<List<int>> source) CancelableOperation<Uint8List>
Collects an asynchronous sequence of byte lists into a single list of bytes.
subscriptionTransformer<T>({Future handleCancel(StreamSubscription<T>)?, void handlePause(StreamSubscription<T>)?, void handleResume(StreamSubscription<T>)?}) StreamTransformer<T, T>
Creates a StreamTransformer that modifies the behavior of subscriptions to a stream.
typedStreamTransformer<S, T>(StreamTransformer transformer) StreamTransformer<S, T>
Creates a wrapper that coerces the type of transformer.
Deprecated('Use Stream.cast after binding a transformer instead')">@Deprecated('Use Stream.cast after binding a transformer instead')