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 viewModel,
    3. Widget? child
    ),
  3. @Deprecated('Prefer to use onViewModelReady instead') dynamic onModelReady(
    1. T viewModel
    )?,
  4. Widget? staticChild,
  5. dynamic onViewModelReady(
    1. T viewModel
    )?,
  6. dynamic onDispose(
    1. T viewModel
    )?,
  7. bool disposeViewModel = true,
  8. bool createNewViewModelOnInsert = false,
  9. bool fireOnViewModelReadyOnce = false,
  10. @Deprecated('Prefer to use fireOnViewModelReadyOnce') bool fireOnModelReadyOnce = false,
  11. bool initialiseSpecialViewModelsOnce = false,
  12. 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,
  @Deprecated('Prefer to use onViewModelReady instead') this.onModelReady,
  this.staticChild,
  this.onViewModelReady,
  this.onDispose,
  this.disposeViewModel = true,
  this.createNewViewModelOnInsert = false,
  this.fireOnViewModelReadyOnce = false,
  @Deprecated('Prefer to use fireOnViewModelReadyOnce')
  this.fireOnModelReadyOnce = false,
  this.initialiseSpecialViewModelsOnce = false,
  Key? key,
})  : providerType = ViewModelBuilderType.reactive,
      super(key: key);