stream_bloc library

Classes

Bloc<Event, State>
Takes a Stream of Events as input and transforms them into a Stream of States as output.
BlocBase<State>
An interface for the core functionality implemented by both Bloc and Cubit.
BlocEventSink<Event extends Object?>
An ErrorSink that supports adding events.
Change<State>
A Change represents the change from one State to another. A Change consists of the currentState and nextState.
Closable
An object that must be closed when no longer in use.
Emittable<State extends Object?>
An object that can emit new states.
EmittableStateStreamableSource<State>
A StateStreamableSource that can emit new states.
ErrorSink
A generic destination for errors.
IStreamBloc<Event extends Object?, State extends Object?>
An interface that combines StreamBlocMapper, StreamBlocTransformers and StreamBlocHooks and represents all required methods for a StreamBloc
MultiBlocObserver
A BlocObserver which supports registering multiple BlocObserver instances. This is useful when maintaining multiple BlocObserver instances for different functions e.g. LoggingBlocObserver, ErrorReportingBlocObserver.
StateStreamable<State>
A Streamable that provides synchronous access to the current state.
StateStreamableSource<State>
A StateStreamable that must be closed when no longer in use.
Streamable<State extends Object?>
An object that provides access to a stream of states over time.
StreamBloc<Event extends Object?, State extends Object?>
Transforms input Events using mapEventToStates into Stream of States as an output.
StreamBlocHooks<Event extends Object?, State extends Object?>
An interface that exposes a list of lifecycle-related methods.
StreamBlocMapper<Event extends Object?, State extends Object?>
An interface that implement BlocEventSink and StateStreamableSource, adding a mapEventToStates method, a method that describes an asynchronous "one-to-many" relationship between events and states.
StreamBlocObserver
Allows observing certain lifecycle stages of corresponding interfaces and provides a mechanism of injecting itself through Zones.
StreamBlocObserverConfig
Class that represents a global, immutable configuration for StreamBlocObserver.
StreamBlocTransformers<Event extends Object?, State extends Object?>
An interface that allows transforming its events and following transitions
Transition<Event, State>
A Transition is the change from one state to another. Consists of the currentState, an event, and the nextState.

Enums

StreamBlocObserverLocation
A sum-type that represents possible locations for injected StreamBlocObservers.

Mixins

BlocLifecycleMixin<Event>
A convenience mixin that allows to associate subscriptions' lifecycles with BlocEventSink's lifecycle, thus emulating automated subscription management.

Typedefs

EventMapper<Event> = Stream<Event> Function(Event event)
Signature for a function which converts an incoming event into an outbound stream of events. Used when defining custom EventTransformers.
EventTransformer<Event> = Stream<Event> Function(Stream<Event> events, EventMapper<Event> mapper)
Used to change how events are processed. By default events are processed concurrently.
TransitionFunction<Event, State> = Stream<Transition<Event, State>> Function(Event event)
Signature for a mapper function which takes an Event as input and outputs a Stream of Transition objects.