LidBuilder handles building a widget in response to new states.
LidBuilder is analogous to StreamBuilder but has simplified API to
reduce the amount of boilerplate code needed.
Specify the stateNotifier.
Please refer to LidListener if you want to "do" anything in response to
state changes such as navigation, showing a dialog, etc...
LidConsumer exposes a builder and listener in order react to new
states.
LidConsumer is analogous to a nested LidListener
and LidBuilder but reduces the amount of boilerplate needed.
LidConsumer should only be used when it is necessary to both rebuild UI
and execute other reactions to state changes in the stateNotifier.
Takes a LidWidgetListener and an optional stateNotifier and invokes
the listener in response to state changes in the stateNotifier.
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 LidBuilder.
Specify the stateNotifier.
LidSelector is analogous to LidBuilder but allows developers to
filter updates by selecting a new value based on the state.
Unnecessary builds are prevented if the selected value does not change.
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 LidBuilder with the current state.
Signature for the builder function which takes the BuildContext and
the state value and is responsible for returning a widget which is to be rendered.
This is analogous to the builder function in StreamBuilder.
Signature for the listener function which takes the BuildContext along
with the state value and is responsible for executing in response to
state changes.
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 LidWidgetListener of LidListener
with the current state