LidBuilder<T> constructor
const
LidBuilder<T> ({
- Key? key,
- required LidWidgetBuilder<
T> builder, - required StateNotifier<
T> stateNotifier, - BuilderCondition<
T> ? buildWhen, - bool animate = false,
- AnimatedSwitcherTransitionBuilder transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
- Duration duration = const Duration(milliseconds: 300),
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...
LidBuilder<StateType>(
stateNotifier: stateNotifier,
builder: (context, state) {
// return widget here based on State Notifier's state
}
)
Implementation
const LidBuilder({
Key? key,
required this.builder,
required this.stateNotifier,
this.buildWhen,
this.animate = false,
this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
this.duration = const Duration(milliseconds: 300),
}) : super(key: key);