ViewModelBuilder<TViewModel extends ViewModel> constructor

const ViewModelBuilder<TViewModel extends ViewModel>({
  1. required TViewModel viewModel,
  2. FutureOr<void> onLoad()?,
  3. required Widget builder(
    1. BuildContext context,
    2. TViewModel viewModel,
    3. BaseEvent? previousEvent,
    4. BaseEvent? event,
    ),
  4. void listener(
    1. BaseEvent? previous,
    2. BaseEvent? current
    )?,
  5. bool buildWhen(
    1. TViewModel viewModel,
    2. BaseEvent? previous,
    3. BaseEvent? current
    )?,
})

Implementation

const ViewModelBuilder({
  required TViewModel viewModel,
  this.onLoad,
  required Widget Function(BuildContext context, TViewModel viewModel,
          BaseEvent? previousEvent, BaseEvent? event)
      builder,
  void Function(BaseEvent? previous, BaseEvent? current)? listener,
  bool Function(
          TViewModel viewModel, BaseEvent? previous, BaseEvent? current)?
      buildWhen,
}) : super(
          builder: builder,
          model: viewModel,
          buildWhen: buildWhen,
          listener: listener);