event_bloc library

Event Bloc is an event-based implementation of the BLoC pattern, the recommended State Management Pattern for Flutter by Google!

Most Important Classes:

  • BlocEventChannel - Fire events up the event Channel tree for seamless integration without coupling!
  • Bloc - The main Building BLoCk of the BLoC Pattern! Build your BLoC layer with these.
  • Repository - Build your Repository Layer with these!

Classes

ActionQueuer<T>
The ActionQueuer class is used to queue up actions and performed within a specific sequence, depending on the implementation.
BaseEventChannel
BaseEventChannel represents a node in a tree of event channels, mirroring the widget tree to an extent. The tree is only connected upwards (child knows its parent).
Bloc
The main building block of your BLoC Layer!
BlocEvent<T>
These are the objects that are propagated up
BlocEventChannel
Over the BaseEventChannel this class has an eventBus and various methods to interact with them. The event bus is primarily used as a general Stream that uses events. The eventBus is a single BaseEventChannel shared among all BlocEventChannels in the same event channel tree.
BlocEventChannelDebugger
Fires Debug Messages using printFunction. The debug messages that are fired are handled by printHandled and printUnhandled
BlocEventListener<T>
These are attached to BaseEventChannels to perform action when a specific type of event passes through the event channel.
BlocEventType<T>
Every BlocEvent has corresponding BlocEventType. This specifies the type of the bloc event as well as differentiating it from other events.
Disposable
Interface that implements a dispose method.
RefreshQueuer
The RefreshQueuer implements the command by causing calls to the queue function while action is currently in progress to cause the action to be called again after the current action is finished.
Repository
This is the building block of your Repository layer.
RepositorySource
RepositorySource holds all the the shared resources of all Repositorys
SingleActionQueuer
The SingleActionQueuer will run the action once and only once. Subsequent calls while action is running will wait until action is done before returning. Calls while action has ran already will be ignored.

Typedefs

BlocEventListenerAction<T> = void Function(BlocEvent<T> event, T value)
Event Listener