BaseView<T extends BaseViewModel<Object> > constructor
BaseView<T extends BaseViewModel<Object> > ({
- required T viewModel,
- dynamic arguments,
- ViewConfig viewConfig = const ViewConfig(inject: true),
- Key? key,
Implementation
BaseView({required T viewModel, dynamic arguments, ViewConfig viewConfig = const ViewConfig(inject: true), super.key}) {
if (viewConfig.inject) {
if (viewConfig.asNewInstance) {
this.viewModel = Locator.registerAsNew<T>(viewModel);
} else {
this.viewModel = Locator.register<T>(viewModel);
}
} else {
this.viewModel = viewModel;
}
this.viewModel.arguments = arguments;
}