BlocBuilder handles building a widget in response to new states.
BlocBuilder is analogous to StreamBuilder but has simplified API to
reduce the amount of boilerplate code needed as well as bloc-specific
performance improvements.
Please refer to BlocListener if you want to "do" anything in response to
state changes such as navigation, showing a dialog, etc...
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.
Takes a BlocWidgetListener and an optional bloc and invokes
the listener in response to state changes in the bloc.
It should be used for functionality that needs to occur only in response to
a state change such as navigation, showing a SnackBar, showing
a Dialog, etc...
The listener is guaranteed to only be called once for each state change
unlike the builder in BlocBuilder.
Takes a create function that is responsible for
creating the Bloc or Cubit and a child which will have access
to the instance via BlocProvider.of(context).
It is used as a dependency injection (DI) widget so that a single instance
of a Bloc or Cubit can be provided to multiple widgets within a subtree.
BlocSelector is analogous to BlocBuilder but allows developers to
filter updates by selecting a new value based on the bloc state.
Unnecessary builds are prevented if the selected value does not change.
a simple filter function to be used inside SimpleEnvironmentFilter
filter for whether to register for the given set of environments
clients can extend this class to maker
their own environmentFilters
Very simple and easy to use service locator
You register your object creation factory or an instance of an object with registerFactory,
registerSingleton or registerLazySingleton
And retrieve the desired object using get or call your locator as function as its a
callable class
Additionally GetIt offers asynchronous creation functions as well as functions to synchronize
the async initialization of multiple Singletons
tp
null: not print log extra info (dev tips, stack, ...)
inner : last FlowR method
- This is where you call the ::logger
self : (dft) last your CustomViewModel(or other class) method
- This is where you call the ::update
outer : invoke FlowR method at log.name
- This is where you call the method that contains the ::update method
all : for dev, print all stack frame info
ValueStreamBuilder handles building a widget in response to new value.
ValueStreamBuilder is analogous to StreamBuilder but has simplified API to
reduce the amount of boilerplate code needed as well as ValueStream-specific
performance improvements.
Signature for the buildWhen function which takes the previous state and
the current state and is responsible for returning a bool which
determines whether to rebuild BlocBuilder with the current state.
Signature for the listenWhen function which takes the previous state
and the current state and is responsible for returning a bool which
determines whether or not to call BlocWidgetListener of BlocListener
with the current state.
Signature for the buildWhen function which takes the previous and
current value and is responsible for returning a bool which
determines whether to rebuild ValueStreamBuilder with the current value.
Signature for the builder function which takes the BuildContext and the current value
and is responsible for returning a widget which is to be rendered.
This is analogous to the builder function in StreamBuilder.
ValueStream listener adapted for FlowR's bloc-backed ValueStream contract.
Signature for the listener function which takes the BuildContext along
with the previous and current value and is responsible for
executing in response to value changes.