ViewModelBuilder<T extends ChangeNotifier>.nonReactive constructor

const ViewModelBuilder<T extends ChangeNotifier>.nonReactive({
  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. dynamic onViewModelReady(
    1. T viewModel
    )?,
  5. dynamic onDispose(
    1. T viewModel
    )?,
  6. bool disposeViewModel = true,
  7. bool createNewViewModelOnInsert = false,
  8. bool fireOnViewModelReadyOnce = false,
  9. @Deprecated('Prefer to use fireOnViewModelReadyOnce') bool fireOnModelReadyOnce = false,
  10. bool initialiseSpecialViewModelsOnce = false,
  11. Key? key,
})

Constructs a ViewModel provider that will not rebuild the provided widget when notifyListeners is called.

Widget from builder will be used as a static child and won't rebuild when notifyListeners is called

Implementation

const ViewModelBuilder.nonReactive({
  required this.viewModelBuilder,
  required this.builder,
  @Deprecated('Prefer to use onViewModelReady instead') this.onModelReady,
  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.nonReactive,
      staticChild = null,
      super(key: key);