zam_core library

Classes

AbstractConnectableStream<T, S extends Subject<T>, R extends Stream<T>>
Base class for implementations of ConnectableStream. S is type of the forwarding Subject. R is return type of autoConnect and refCount (type constraint: S extends R).
AsyncDisposable<T extends Object?>
An interface to force implement async dispose function.
AsyncInitializable<T extends Object?>
An interface to force implement async initialize function.
AsyncLoadable<T extends Object?>
AsyncNestedInitializable<OUTPUT extends Object?, INNER_OUTPUT extends Object?>
AsyncRunnable<T extends Object?>
AsyncStartable<T extends Object?>
AsyncStoppable<T extends Object?>
BehaviorSubject<T>
A special StreamController that captures the latest item that has been added to the controller, and emits that as the first item to any new listener.
BufferCountStreamTransformer<T>
Buffers a number of values from the source Stream by count then emits the buffer and clears it, and starts a new buffer each startBufferEvery values. If startBufferEvery is not provided, then new buffers are started immediately at the start of the source and when each buffer closes and is emitted.
BufferStreamTransformer<T>
Creates a Stream where each item is a List containing the items from the source sequence.
BufferTestStreamTransformer<T>
Creates a Stream where each item is a List containing the items from the source sequence, batched whenever test passes.
Categorizable<T extends Object?>
Cloneable<T extends Object?>
An interface to force implement clone functionality.
CombineLatestStream<T, R>
Merges the given Streams into one Stream sequence by using the combiner function whenever any of the source stream sequences emits an item.
CompositeSubscription
Acts as a container for multiple subscriptions that can be canceled at once e.g. view subscriptions in Flutter that need to be canceled on view disposal
ConcatEagerStream<T>
Concatenates all of the specified stream sequences, as long as the previous stream sequence terminated successfully.
ConcatStream<T>
Concatenates all of the specified stream sequences, as long as the previous stream sequence terminated successfully.
ConnectableStream<T>
A ConnectableStream resembles an ordinary Stream, except that it can be listened to multiple times and does not begin emitting items when it is listened to, but only when its connect method is called.
ConnectableStreamSubscription<T>
A special StreamSubscription that not only cancels the connection to the source Stream, but also closes down a subject that drives the Stream.
Copyable<T extends Object?>
An interface to force implement copyWith functionality.
DebounceStreamTransformer<T>
Transforms a Stream so that will only emit items from the source sequence if a window has completed, without the source sequence emitting another item.
DefaultIfEmptyStreamTransformer<S>
Emit items from the source Stream, or a single default item if the source Stream emits nothing.
DeferStream<T>
The defer factory waits until a listener subscribes to it, and then it creates a Stream with the given factory function.
DelayStreamTransformer<S>
The Delay operator modifies its source Stream by pausing for a particular increment of time (that you specify) before emitting each of the source Stream’s items. This has the effect of shifting the entire sequence of items emitted by the Stream forward in time by that specified increment.
DelayWhenStreamTransformer<T>
Delays the emission of items from the source Stream by a given time span determined by the emissions of another Stream.
DematerializeStreamTransformer<S>
Converts the onData, onDone, and onError Notification objects from a materialized stream into normal onData, onDone, and onError events.
Disposable<T extends Object?>
An interface to force implement dispose function.
DistinctUniqueStreamTransformer<S>
Create a Stream which implements a HashSet under the hood, using the provided equals as equality.
DoStreamTransformer<S>
Invokes the given callback at the corresponding point the the stream lifecycle. For example, if you pass in an onDone callback, it will be invoked when the stream finishes emitting items.
EndWithManyStreamTransformer<S>
Appends a sequence of values to the source Stream.
EndWithStreamTransformer<S>
Appends a value to the source Stream before closing.
Entity<MODEL extends Model>
Equatable
A base class to facilitate operator == and hashCode overrides.
EquatableConfig
The default configurion for all Equatable instances.
ErrorAndStackTrace
An Object which acts as a tuple containing both an error and the corresponding stack trace.
Executable<OUTPUT extends Object?>
An interface to force implement execute function.
ExhaustMapStreamTransformer<S, T>
Converts events from the source stream into a new Stream using a given mapper. It ignores all items from the source stream until the new stream completes.
FlatMapStreamTransformer<S, T>
Converts each emitted item into a new Stream using the given mapper function, while limiting the maximum number of concurrent subscriptions to these Streams. The newly created Stream will be listened to and begin emitting items downstream.
ForkJoinStream<T, R>
This operator is best used when you have a group of streams and only care about the final emitted value of each. One common use case for this is if you wish to issue multiple requests on page load (or some other event) and only want to take action when a response has been received for all.
FromCallableStream<T>
Returns a Stream that, when listening to it, calls a function you specify and then emits the value returned from that function.
GroupByStreamTransformer<T, K>
The GroupBy operator divides a Stream that emits items into a Stream that emits GroupedStream, each one of which emits some subset of the items from the original source Stream.
GroupedStream<T, K>
The Stream used by GroupByStreamTransformer, it contains events that are grouped by a key value.
Identifiable<T extends Object?>
Most commonly used interface in classes with keys to identify objects. key is supposed to be unique. Can be used in == operator and hashCode overrides.
IgnoreElementsStreamTransformer<S>
Creates a Stream where all emitted items are ignored, only the error / completed notifications are passed
Immutable
Used to annotate a class.
Initializable<T extends Object?>
An interface to force implement initialize function.
IntervalStreamTransformer<S>
Creates a Stream that emits each item in the Stream after a given duration.
Loadable<T extends Object?>
MapNotNullStreamTransformer<T, R extends Object>
Create a Stream containing only the non-null results of applying the given transform function to each element of the Stream.
MapToStreamTransformer<S, T>
Emits the given constant value on the output Stream every time the source Stream emits a value.
MaterializeStreamTransformer<S>
Converts the onData, on Done, and onError events into Notification objects that are passed into the downstream onData listener.
MergeStream<T>
Flattens the items emitted by the given streams into a single Stream sequence.
Model
Contains domain data.
NestedInitializable<OUTPUT extends Object?, INNER_OUTPUT extends Object?>
NeverStream<T>
Returns a non-terminating stream sequence, which can be used to denote an infinite duration.
Notification<T>
A class that encapsulates the Kind of event, value of the event in case of onData, or the Error in the case of onError. A container object that wraps the Kind of event (OnData, OnDone, OnError), and the item or error that was emitted. In the case of onDone, no data is emitted as part of the Notification.
OnErrorResumeStreamTransformer<S>
Intercepts error events and switches to a recovery stream created by the provided recoveryFn Function.
PairwiseStreamTransformer<T>
Emits the n-th and n-1th events as a pair. The first event won't be emitted until the second one arrives.
Parameterized<INPUT extends Object?>
PublishConnectableStream<T>
A ConnectableStream that converts a single-subscription Stream into a broadcast Stream.
PublishSubject<T>
Exactly like a normal broadcast StreamController with one exception: this class is both a Stream and Sink.
RaceStream<T>
Given two or more source streams, emit all of the items from only the first of these streams to emit an item or notification.
RangeStream
Returns a Stream that emits a sequence of Integers within a specified range.
RepeatStream<T>
Creates a Stream that will recreate and re-listen to the source Stream the specified number of times until the Stream terminates successfully.
ReplayConnectableStream<T>
A ConnectableStream that converts a single-subscription Stream into a broadcast Stream that replays emitted items to any new listener, and provides synchronous access to the list of emitted values.
ReplayStream<T>
An Stream that provides synchronous access to the emitted values
ReplaySubject<T>
A special StreamController that captures all of the items that have been added to the controller, and emits those as the first items to any new listener.
Required
Used to annotate a named parameter p in a method or function f.
ResourceIdentifier
Annotates a static method as referencing a native resource.
RetryStream<T>
Creates a Stream that will recreate and re-listen to the source Stream the specified number of times until the Stream terminates successfully.
RetryWhenStream<T>
Creates a Stream that will recreate and re-listen to the source Stream when the notifier emits a new value. If the source Stream emits an error or it completes, the Stream terminates.
Runnable<T extends Object?>
Rx
A utility class that provides static methods to create the various Streams provided by RxDart.
SampleStreamTransformer<T>
A StreamTransformer that, when the specified window Stream emits an item or completes, emits the most recently emitted item (if any) emitted by the source Stream since the previous emission from the sample Stream.
ScanStreamTransformer<S, T>
Applies an accumulator function over an stream sequence and returns each intermediate result. The seed value is used as the initial accumulator value.
SequenceEqualStream<S, T>
Determine whether two Streams emit the same sequence of items. You can provide an optional equals handler to determine equality.
Serializable
An interface to force implement serialization.
Service
SkipLastStreamTransformer<T>
Skip the last count items emitted by the source Stream
SkipUntilStreamTransformer<S, T>
Starts emitting events only after the given stream emits an event.
Startable<T extends Object?>
StartWithManyStreamTransformer<S>
Prepends a sequence of values to the source Stream.
StartWithStreamTransformer<S>
Prepends a value to the source Stream.
Stoppable<T extends Object?>
Subject<T>
The base for all Subjects. If you'd like to create a new Subject, extend from this class.
SubscriptionManager
SwitchIfEmptyStreamTransformer<S>
When the original stream emits no items, this operator subscribes to the given fallback stream and emits items from that stream instead.
SwitchLatestStream<T>
Convert a Stream that emits Streams (aka a 'Higher Order Stream') into a single Stream that emits the items emitted by the most-recently-emitted of those Streams.
SwitchMapStreamTransformer<S, T>
Converts each emitted item into a new Stream using the given mapper function. The newly created Stream will be be listened to and begin emitting items, and any previously created Stream will stop emitting.
TakeLastStreamTransformer<T>
Emits only the final count values emitted by the source Stream.
TakeUntilStreamTransformer<S, T>
Returns the values from the source stream sequence until the other stream sequence produces a value.
TakeWhileInclusiveStreamTransformer<S>
Emits values emitted by the source Stream so long as each value satisfies the given test. When the test is not satisfied by a value, it will emit this value as a final event and then complete.
ThrottleStreamTransformer<T>
A StreamTransformer that emits a value from the source Stream, then ignores subsequent source values while the window Stream is open, then repeats this process.
TimeInterval<T>
A class that represents a snapshot of the current value emitted by a Stream, at a specified interval.
TimeIntervalStreamTransformer<S>
Records the time interval between consecutive values in an stream sequence.
TimerStream<T>
Emits the given value after a specified amount of time.
Timestamped<T>
A class that represents a snapshot of the current value emitted by a Stream, at a specified timestamp.
TimestampStreamTransformer<S>
Wraps each item emitted by the source Stream in a Timestamped object that includes the emitted item and the time when the item was emitted.
Undoable<T extends Object?>
UseResult
See useResult for more details.
UsingStream<T, R>
When listener listens to it, creates a resource object from resource factory function, and creates a Stream from the given factory function and resource as argument. Finally when the stream finishes emitting items or stream subscription is cancelled (call StreamSubscription.cancel or Stream.listen(cancelOnError: true)), call the disposer function on resource object.
Validatable<T extends Object?>
ValueConnectableStream<T>
A ConnectableStream that converts a single-subscription Stream into a broadcast Stream that replays the latest value to any new listener, and provides synchronous access to the latest emitted value.
ValueStream<T>
An Stream that provides synchronous access to the last emitted item
ViewModel
Contains data that could be bound to the views in user interface.
WhereNotNullStreamTransformer<T extends Object>
Create a Stream which emits all the non-null elements of the Stream, in their original emission order.
WhereTypeStreamTransformer<S, T>
This transformer is a shorthand for Stream.where followed by Stream.cast.
WindowCountStreamTransformer<T>
Buffers a number of values from the source Stream by count then emits the buffer as a Stream and clears it, and starts a new buffer each startBufferEvery values. If startBufferEvery is not provided, then new buffers are started immediately at the start of the source and when each buffer closes and is emitted.
WindowStreamTransformer<T>
Creates a Stream where each item is a Stream containing the items from the source sequence.
WindowTestStreamTransformer<T>
Creates a Stream where each item is a Stream containing the items from the source sequence, batched whenever test passes.
WithLatestFromStreamTransformer<S, T, R>
A StreamTransformer that emits when the source stream emits, combining the latest values from the two streams using the provided function.
ZipStream<T, R>
Merges the specified streams into one stream sequence using the given zipper Function whenever all of the stream sequences have produced an element at a corresponding index.

Enums

ExceptionSeverity
ExceptionSeverity is an enum with the following values.
Kind
The type of event used in Notification

Mixins

CallToExecute<OUTPUT extends Object?>
A mixin on Executable.
EquatableMixin
A mixin that helps implement equality without needing to explicitly override operator == and hashCode.

Extensions

AddToCompositeSubscriptionExtension on StreamSubscription<T>
Extends the StreamSubscription class with the ability to be added to CompositeSubscription container.
BufferExtensions on Stream<T>
Extends the Stream class with the ability to buffer events in various ways
ConcatExtensions on Stream<T>
Extends the Stream class with the ability to concatenate one stream with another.
ConnectableStreamExtensions on Stream<T>
Extends the Stream class with the ability to transform a single-subscription Stream into a ConnectableStream.
DebounceExtensions on Stream<T>
Extends the Stream class with the ability to debounce events in various ways
DefaultIfEmptyExtension on Stream<T>
DelayExtension on Stream<T>
Extends the Stream class with the ability to delay events being emitted
DelayWhenExtension on Stream<T>
Extends the Stream class with the ability to delay events being emitted.
DematerializeExtension on Stream<Notification<T>>
Converts the onData, onDone, and onError Notifications from a materialized stream into normal onData, onDone, and onError events.
DistinctUniqueExtension on Stream<T>
Extends the Stream class with the ability to skip items that have previously been emitted.
DoExtensions on Stream<T>
Extends the Stream class with the ability to execute a callback function at different points in the Stream's lifecycle.
EndWithExtension on Stream<T>
Extends the Stream class with the ability to emit the given value as the final item before closing.
EndWithManyExtension on Stream<T>
Extends the Stream class with the ability to emit the given value as the final item before closing.
ExhaustMapExtension on Stream<T>
Extends the Stream class with the ability to transform the Stream into a new Stream. The new Stream emits items and ignores events from the source Stream until the new Stream completes.
FlatMapExtension on Stream<T>
Extends the Stream class with the ability to convert the source Stream into a new Stream each time the source emits an item.
GroupByExtension on Stream<T>
Extends the Stream class with the ability to convert events into Streams of events that are united by a key.
IgnoreElementsExtension on Stream<T>
Extends the Stream class with the ability to skip, or ignore, data events.
IntervalExtension on Stream<T>
Extends the Stream class with the ability to emit each item after a given duration.
MapNotNullExtension on Stream<T>
Extends the Stream class with the ability to convert the source Stream to a Stream containing only the non-null results of applying the given transform function to each element of this Stream.
MapToExtension on Stream<S>
Extends the Stream class with the ability to convert each item to the same value.
MaterializeExtension on Stream<T>
Extends the Stream class with the ability to convert the onData, on Done, and onError events into Notifications that are passed into the downstream onData listener.
MaxExtension on Stream<T>
Extends the Stream class with the ability to transform into a Future that completes with the largest item emitted by the Stream.
MergeExtension on Stream<T>
Extends the Stream class with the ability to merge one stream with another.
MinExtension on Stream<T>
Extends the Stream class with the ability to transform into a Future that completes with the smallest item emitted by the Stream.
OnErrorExtensions on Stream<T>
Extends the Stream class with the ability to recover from errors in various ways
PairwiseExtension on Stream<T>
Extends the Stream class with the ability to emit the nth and n-1th events as a pair
SampleExtensions on Stream<T>
Extends the Stream class with the ability to sample events from the Stream
ScanExtension on Stream<T>
Extends
SkipLastExtension on Stream<T>
Extends the Stream class with the ability to skip the last count items emitted by the source Stream
SkipUntilExtension on Stream<T>
Extends the Stream class with the ability to skip events until another Stream emits an item.
StartWithExtension on Stream<T>
Extends the Stream class with the ability to emit the given value as the first item.
StartWithManyExtension on Stream<T>
Extends the Stream class with the ability to emit the given values as the first items.
SwitchIfEmptyExtension on Stream<T>
Extend the Stream class with the ability to return an alternative Stream if the initial Stream completes with no items.
SwitchMapExtension on Stream<T>
Extends the Stream with the ability to convert one stream into a new Stream whenever the source emits an item. Every time a new Stream is created, the previous Stream is discarded.
TakeLastExtension on Stream<T>
Extends the Stream class with the ability receive only the final count events from the source Stream.
TakeUntilExtension on Stream<T>
Extends the Stream class with the ability receive events from the source Stream until another Stream produces a value.
TakeWhileInclusiveExtension on Stream<T>
Extends the Stream class with the ability to take events while they pass the condition given and include last event that doesn't pass the condition.
ThrottleExtensions on Stream<T>
Extends the Stream class with the ability to throttle events in various ways
TimeIntervalExtension on Stream<T>
Extends the Stream class with the ability to record the time interval between consecutive values in an stream
TimeStampExtension on Stream<T>
Extends the Stream class with the ability to wrap each item emitted by the source Stream in a Timestamped object that includes the emitted item and the time when the item was emitted.
WhereNotNullExtension on Stream<T?>
Extends the Stream class with the ability to convert the source Stream to a Stream which emits all the non-null elements of this Stream, in their original emission order.
WhereTypeExtension on Stream<T>
Extends the Stream class with the ability to filter down events to only those of a specific type.
WindowExtensions on Stream<T>
Extends the Stream class with the ability to window
WithLatestFromExtensions on Stream<T>
Extends the Stream class with the ability to merge the source Stream with the last emitted item from another Stream.
ZipWithExtension on Stream<T>
Extends the Stream class with the ability to zip one Stream with another.

Constants

alwaysThrows → const _AlwaysThrows
Used to annotate a function f. Indicates that f always throws an exception. Any functions that override f, in class inheritance, are also expected to conform to this contract.
checked → const _Checked
Used to annotate a parameter of an instance method that overrides another method.
doNotStore → const _DoNotStore
Used to annotate a method, getter or top-level getter or function to indicate that the value obtained by invoking it should not be stored in a field or top-level variable. The annotation can also be applied to a class to implicitly annotate all of the valid members of the class, or applied to a library to annotate all of the valid members of the library, including classes. If a value returned by an element marked as doNotStore is returned from a function or getter, that function or getter should be similarly annotated.
doNotSubmit → const _DoNotSubmit
Used to annotate a method, getter or top-level getter or function that is not intended to be accessed in checked-in code, but might be ephemerally used during development or local testing.
experimental → const _Experimental
Used to annotate a library, or any declaration that is part of the public interface of a library (such as top-level members, class members, and function parameters) to indicate that the annotated API is experimental and may be removed or changed at any-time without updating the version of the containing package, despite the fact that it would otherwise be a breaking change.
factory → const _Factory
Used to annotate an instance or static method m. Indicates that m must either be abstract or must return a newly allocated object or null. In addition, every method that either implements or overrides m is implicitly annotated with this same annotation.
immutable → const Immutable
Used to annotate a class C. Indicates that C and all subtypes of C must be immutable.
internal → const _Internal
Used to annotate a declaration which should only be used from within the package in which it is declared, and which should not be exposed from said package's public API.
isTest → const _IsTest
Used to annotate a test framework function that runs a single test.
isTestGroup → const _IsTestGroup
Used to annotate a test framework function that runs a group of tests.
literal → const _Literal
Used to annotate a const constructor c. Indicates that any invocation of the constructor must use the keyword const unless one or more of the arguments to the constructor is not a compile-time constant.
mustBeConst → const _MustBeConst
Used to annotate a parameter which should be constant.
mustBeOverridden → const _MustBeOverridden
Used to annotate an instance member m declared on a class or mixin C. Indicates that every subclass of C, concrete or abstract, must directly override m.
mustCallSuper → const _MustCallSuper
Used to annotate an instance member (method, getter, setter, operator, or field) m. Indicates that every invocation of a member that overrides m must also invoke m. In addition, every method that overrides m is implicitly annotated with this same annotation.
nonVirtual → const _NonVirtual
Used to annotate an instance member (method, getter, setter, operator, or field) m in a class C or mixin M. Indicates that m should not be overridden in any classes that extend or mixin C or M.
optionalTypeArgs → const _OptionalTypeArgs
Used to annotate a class, mixin, extension, function, method, or typedef declaration C. Indicates that any type arguments declared on C are to be treated as optional.
protected → const _Protected
Used to annotate an instance member in a class or mixin which is meant to be visible only within the declaring library, and to other instance members of the class or mixin, and their subtypes.
redeclare → const _Redeclare
Used to annotate an instance member of an extension type that redeclares a member from a superinterface.
reopen → const _Reopen
Annotation for intentionally loosening restrictions on subtyping that would otherwise cause lint warnings to be produced by the implicit_reopen lint.
required → const Required
Used to annotate a named parameter p in a method or function f. Indicates that every invocation of f must include an argument corresponding to p, despite the fact that p would otherwise be an optional parameter.
sealed → const _Sealed
Annotation marking a class as not allowed as a super-type outside of the current package.
useResult → const UseResult
Used to annotate a method, field, or getter within a class, mixin, or extension, or a or top-level getter, variable or function to indicate that the value obtained by invoking it should be used. A value is considered used if it is assigned to a variable, passed to a function, or used as the target of an invocation, or invoked (if the result is itself a function).
virtual → const _Virtual
Used to annotate a field that is allowed to be overridden in Strong Mode.
visibleForOverriding → const _VisibleForOverriding
Used to annotate an instance member that was made public so that it could be overridden but that is not intended to be referenced from outside the defining library.
visibleForTesting → const _VisibleForTesting
Used to annotate a declaration that was made public, so that it is more visible than otherwise necessary, to make code testable.

Properties

emptyCallback VoidCallback
An empty function that can be used in assigning default values for Callback.
no setter
emptyParameterizedCallback ParameterizedVoidCallback<Object?>
An empty parameterized function that can be used in assigning default values for ParameterizedCallback.
no setter

Typedefs

Builder<INSTANCE extends Object?> = INSTANCE Function()
Example:
Callback<OUTPUT extends Object?> = OUTPUT Function()
Example:
Deserialize<T extends Object?> = T Function(Json json)
Alias for function that converts a map in to an object.
ExceptionBuilder<EXCEPTION extends NamedException> = EXCEPTION Function()
Initialize<T extends Object?> = T Function()
Json = Map<String, Object?>
ParameterizedBuilder<INPUT extends Object?, INSTANCE extends Object?> = INSTANCE Function(INPUT input)
Example:
ParameterizedCallback<INPUT extends Object?, OUTPUT extends Object?> = OUTPUT Function(INPUT input)
Example:
ParameterizedExceptionBuilder<INPUT extends Object?, EXCEPTION extends NamedException> = EXCEPTION Function(INPUT input)
ParameterizedVoidCallback<INPUT extends Object?> = void Function(INPUT input)
Example:
Serialize<T extends Object?> = Json Function(T item)
Alias for function that converts a object in to an map.
VoidCallback = void Function()
Example:

Exceptions / Errors

BasicException
Exception that can be created on the fly.
EmptyException
A simple empty exception that can be created on the fly.
NamedException
Wrapper around the built-in Exception class.
UnknownException
Exceptions that are not expected but handled in the else part and sent to the user interface.
ValueStreamError
The error throw by ValueStream.value or ValueStream.error.