bloc library


Bloc<Event, State>
Takes a Stream of Events as input and transforms them into a Stream of States as output.
An interface for observing the behavior of Bloc and Cubit instances.
A Change represents the change from one State to another. A Change consists of the currentState and nextState.
A Cubit is a subset of Bloc which has no notion of events and relies on methods to emit new states. [...]
Transition<Event, State>
Occurs when an event is added after mapEventToState has been called but before the bloc's State has been updated. A Transition consists of the currentState, the event which was added, and the nextState.


TransitionFunction<Event, State> = Stream<Transition<Event, State>> Function(Event)
Signature for a mapper function which takes an Event as input and outputs a Stream of Transition objects.

Exceptions / Errors

Exception thrown when an unhandled error occurs within a Cubit. [...]