Some API may be changed.
The collection of useful utils and architecture base classes.
response_parser
- helps toEither
format.fpdart
and functional_extensions
- mainaction_bloc
- subtype of the bloc which converts an action execution to theinProgress
and success
/failure
states.facade_consumer_cubit
- cubit which shortcuts the subscribing andreactive_facade
- helps to make the work with the infrastracture layer reactive.Take a look at the example app to see these parts in action
Action bloc is used to automatically map action
to the states. It's supposed to
be used with the ReactiveFacade
.
action
is a function which performs an action that should be mapped to the states.
It may be similar to the FutureBuilder
which also maps action to the states however
action blocs are more advanced.
It works this way:
in progress
state is emittedsuccess
state is emittedfailure
state with an error is emitted.To map an action
to the states bloc is using IStateAdapter
.
This is an adapter provided by user which takes an action with event, executes it
and returns an Either
of result or error.
It's a base for the cubit which listens to the ReactiveFacade.dataStream
.
As you may know facade is a pattern which provides a simplified interface to complex set of classes. In our case these classes are api and local repositories.
Reactive Facade's goal is to be a single source of truth, hide the data synchronization and provide the reactive api.