LidBuilder<T> constructor

const LidBuilder<T>({
  1. Key? key,
  2. required LidWidgetBuilder<T> builder,
  3. required StateNotifier<T> stateNotifier,
  4. BuilderCondition<T>? buildWhen,
  5. bool animate = false,
  6. AnimatedSwitcherTransitionBuilder transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
  7. 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);