bloc_generator_annotations 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.
BlocEvent
BlocEvents
BlocEventSink<Event extends Object?>
An ErrorSink that supports adding events.
BlocObserver
An interface for observing the behavior of Bloc instances.
BlocState
BlocStates
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.
Concurrent
Cubit<State>
A Cubit is similar to Bloc but has no notion of events and relies on methods to emit new states.
Debounce
Droppable
Emittable<State extends Object?>
An object that can emit new states.
EmittableStateStreamableSource<State>
A StateStreamableSource that can emit new states.
Emitter<State>
An Emitter is a class which is capable of emitting new states.
Equatable
A base class to facilitate operator == and hashCode overrides.
EquatableConfig
The default configuration for all Equatable instances.
ErrorSink
A generic destination for errors.
EventGenerated
MultiBlocObserver
A BlocObserver which supports registering multiple BlocObserver instances. This is useful when maintaining multiple BlocObserver instances for different functions e.g. LoggingBlocObserver, ErrorReportingBlocObserver.
RateLimiter
Restartable
Sequential
SimpleTransformer
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.
Throttle
Transformer
Transition<Event, State>
A Transition is the change from one state to another. Consists of the currentState, an event, and the nextState.

Mixins

BlocTransformerMixin<Event, State>
EquatableMixin
A mixin that helps implement equality without needing to explicitly override operator == and hashCode.

Functions

concurrent<Event>() EventTransformer<Event>
Process events concurrently.
debounce<Event>(Duration duration, {EventTransformer<Event>? andThen}) EventTransformer<Event>
Debounce: waits duration of silence after the last event, then processes the most recent one.
droppable<Event>() EventTransformer<Event>
Process only one event and ignore (drop) any new events until the current event is done.
restartable<Event>() EventTransformer<Event>
Process only one event by cancelling any pending events and processing the new event immediately.
sequential<Event>() EventTransformer<Event>
Process events one at a time by maintaining a queue of added events and processing the events sequentially.
throttle<Event>(Duration duration, {EventTransformer<Event>? andThen}) EventTransformer<Event>
Throttle: processes the first event immediately, then ignores every subsequent event for duration (leading-edge throttle).

Typedefs

EventHandler<Event, State> = FutureOr<void> Function(Event event, Emitter<State> emit)
An event handler is responsible for reacting to an incoming Event and can emit zero or more states via the Emitter.
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.