What is BlocConsumer Flutter?

BlocConsumer exposes a builder and listener in order react to new states . BlocConsumer is analogous to a nested BlocListener and BlocBuilder but reduces the amount of boilerplate needed. BlocConsumer should only be used when it is necessary to both rebuild UI and execute other reactions to state changes in the bloc.

Read more

What is a BlocProvider?

BlocProvider is a Flutter widget which provides a bloc to its children via BlocProvider. of<T>(context) . It is used as a dependency injection (DI) widget so that a single instance of a bloc can be provided to multiple widgets within a subtree.

Read more

What are Bloc events?

Bloc is similar to Cubit , but it uses events to do all its work . Like Cubit , the state is held in the Bloc , then to change or add new state, events are added to the Bloc . When an event is added to the Bloc , the onEvent method is called. After this onEvent method is called, a transform events method is called.

Read more

What is BlocSupervisor?

BlocSupervisor oversees Bloc s and delegates to BlocDelegate . BlocDelegate handles events from all Bloc s which are delegated by the BlocSupervisor . Can be used to intercept all Bloc events, transitions, and errors. It is a great way to handle logging/analytics as well as error handling universally.

Read more