navigate<V extends ViewModel> method

Future navigate<V extends ViewModel>(
  1. {Object parameter}

Navigates to a new viewmodel of the type specified by the generic.

The parameter is a value that will be passed to the new viewmodel's init method.


Future navigate<V extends ViewModel>({Object parameter}) async {
  var _viewModel = createViewModel<V>(parameter);

  var routeName = Core._viewLocator.getViewFromViewModelType<V>();

  await Navigator.of(_viewContext)
      .pushNamed(routeName, arguments: _viewModel);