Contains utility classes in the style of
dart:async to work with asynchronous
StreamZip class can combine several streams of events into a single stream
of tuples of events.
The package introduces a
Result class that can hold either a value or an
error. It allows capturing an asynchronous computation which can give either a
value or an error, into an asynchronous computation that always gives a
value, where errors can be treated as data. It also allows releasing the
Result back into an asynchronous computation.
typedStreamTransformer() function. This wraps an untyped
StreamTransformer with the correct type parameters, and asserts the types of
events as they're emitted from the transformed stream.
StreamSinkTransformer.typed() static method. This wraps an untyped
StreamSinkTransformer with the correct type parameters, and asserts the
types of arguments passed in to the resulting sink.
methods. These wrap untyped instances of these classes with the correct type
parameter, and assert the types of values as they're accessed.
DelegatingStream class. This is behaviorally identical to
dart:async, but it follows this package's naming conventions and
DelegatingStream.typed() static method.
Fix all strong mode warnings and add generic method annotations.
new DelegatingEventSink(), and
DelegatingStreamSink() now take arguments with generic type arguments (for
Stream<T>) rather than without (for example
Passing a type that wasn't
is-compatible with the fully-specified generic
would already throw an error under some circumstances, so this is not
considered a breaking change.
ErrorResult now takes a type parameter.
Result.asError now returns a
Deprecate top-level libraries other than
exports these libraries' interfaces.
Result.releaseSinkTransformer should be used instead.
StreamSinkCompleter, for creating a
StreamSink now and providing its
destination later as another sink.
StreamCompleter.setError, a shortcut for emitting a single error event
on the resulting stream.
NullStreamSink, an implementation of
StreamSink that discards all
StreamTransformerthat converts a broadcast stream into a single-subscription stream.
CancelableOperation.valueOrCancellation(), which allows users to be
notified when an operation is canceled elsewhere.
StreamSinkTransformer which transforms events before they're passed to
StreamSink, similarly to how
StreamTransformer transforms events after
they're emitted by a stream.
LazyStream, which forwards to the return value of a callback that's only called when the stream is listened to.
AsyncMemoizer.future, which allows the result to be accessed before
runOnce() is called.
CancelableOperation, an asynchronous operation that can be canceled.
It can be created using a
RestartableTimer, a non-periodic timer that can be reset over and
StreamCompleter class for creating a stream now and providing its
events later as another stream.
StreamQueue class which allows requesting events from a stream
before they are avilable. It is like a
StreamIterator that can queue
SubscriptionStream which creates a single-subscription stream
from an existing stream subscription.
ResultFuture class for synchronously accessing the result of a
FutureGroup.isIdle, which provide visibility
into whether a group is actively waiting on any futures.
AsyncMemoizer class for running an asynchronous block of code exactly
Added delegating wrapper classes for a number of core async types:
DelegatingStreamSubscription. These are all simple wrappers that forward all
calls to the wrapped objects. They can be used to expose only the desired
interface for subclasses, or extended to add extra functionality.
FutureGroup class for waiting for a group of futures, potentially of
unknown size, to complete.
StreamGroup class for merging the events of a group of streams,
potentially of unknown size.
StreamSplitter class for splitting a stream into multiple new
Add this to your package's pubspec.yaml file:
dependencies: async: "^1.11.3"
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|2.0.7||May 3, 2018|
|2.0.6||Mar 3, 2018|
|2.0.5||Feb 27, 2018|
|2.0.4||Feb 10, 2018|
|2.0.3||Jan 5, 2018|
|2.0.2||Jan 3, 2018|
|2.0.1||Oct 3, 2017|
|2.0.0||Aug 29, 2017|
|1.13.3||May 17, 2017|
|1.13.2||Feb 20, 2017|
We analyzed this package on Jul 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Detected platforms: Flutter, web, other
No platform restriction found in primary library
Fix analysis and formatting issues.
Analysis or formatting checks reported 12 errors 132 hints.
Strong-mode analysis of
lib/src/restartable_timer.dartfailed with the following error:
line: 11 col: 7
Missing concrete implementation of getter 'Timer.tick'.
Strong-mode analysis of
lib/src/result.dartfailed with the following error:
line: 93 col: 7
The return type 'Future<Future<T>>' isn't a 'Future<T>', as defined by the method 'release'.
Similar analysis of the following files failed:
Package is getting outdated.
The package was released 89 weeks ago.
Maintain an example.
Create a short demo in the
example/directory to show how to use this package. Common file name patterns include:
example.dartor you could also use