event_bloc_widgets library

This contains the widgets that go along with the base dart EventBloc

See RepositoryProvider and BlocProvider for good places to start.

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!
BlocBuilder<T extends Bloc>
This lets you define a builder for a Bloc that can be used for MultiBlocProvider and TestEnvironment
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
BlocEventChannelDebuggerProvider
Provides a BlocEventChannelDebugger. This allows you to handle how your debugger will behave instead of just using the default.
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.
BlocNotifier<T extends Bloc>
maps the Bloc to the ChangeNotifier widget from Provider
BlocProvider<T extends Bloc>
Provides a Bloc and will automatically wrap and provide the equivalent BlocNotifier and BlocEventChannel
Disposable
Interface that implements a dispose method.
MultiBlocProvider
Provides multiple Blocs through BlocBuilders
MultiRepositoryProvider
Provides multiple Repositorys through RepositoryBuilders
Readable
Provides a context for dependencies
ReadableFromFunc
Simple Implementation of Readable. Typically this will be used as an Adapter.
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.
RepositoryBuilder<T extends Repository>
This lets you define a builder for a Repository that can be used for MultiRepositoryProvider and TestEnvironment
RepositoryProvider<T extends Repository>
Provides a Repository down the Widget tree. Will also automatically call necessary functions to initialize the Repository.
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.
TestEnvironment
This builds a similar environment to the Flutter Widget Tree to be used for Unit Tests. This allows the environment for the widget tests and unit tests to be the same, so long as they use the same blocBuilders and repositoryBuilders.

Extensions

EventBlocBuildContext on BuildContext
Adds event bloc convenience functions to BuildContext

Typedefs

BlocEventListenerAction<T> = void Function(BlocEvent<T> event, T value)
Event Listener
CreateBloc<T extends Bloc> = T Function(Readable reader, BlocEventChannel? parentChannel)
Creates a bloc instance with parentChannel and using dependencies from reader
CreateRepository<T extends Repository> = T Function(Readable reader)
Creates a repository instance using dependencies from reader