ViewModelBuilder<T extends ChangeNotifier>.reactive constructor

const ViewModelBuilder<T extends ChangeNotifier>.reactive({
  1. required T viewModelBuilder(),
  2. required Widget builder(
    1. BuildContext context,
    2. T model,
    3. Widget? child
    ),
  3. Widget? staticChild,
  4. dynamic onModelReady(
    1. T model
    )?,
  5. dynamic onDispose(
    1. T model
    )?,
  6. bool disposeViewModel = true,
  7. bool createNewModelOnInsert = false,
  8. bool fireOnModelReadyOnce = false,
  9. bool initialiseSpecialViewModelsOnce = false,
  10. Key? key,
})

Constructs a ViewModel provider that fires the builder function when notifyListeners is called in the ViewModel.

Implementation

const ViewModelBuilder.reactive({
  required this.viewModelBuilder,
  required this.builder,
  this.staticChild,
  this.onModelReady,
  this.onDispose,
  this.disposeViewModel = true,
  this.createNewModelOnInsert = false,
  this.fireOnModelReadyOnce = false,
  this.initialiseSpecialViewModelsOnce = false,
  Key? key,
})  : providerType = _ViewModelBuilderType.Reactive,
      super(key: key);