backStackHostViewModel
Returns a ViewModel using a ViewModelStoreOwner resolved from the back stack host context.
This is useful for obtaining ViewModels that are scoped to the host of the back stack.
Return
An instance of the specified ViewModel.
Parameters
The type of the ViewModel.
The ViewModelStoreOwner that will host this ViewModel. Defaults to the current LocalBackStackHostViewModelStoreOwner if available, otherwise falls back to the current LocalViewModelStoreOwner.
An optional key to differentiate amongst ViewModels of the same type.
An optional ViewModelProvider.Factory to use for creating the ViewModel.
The CreationExtras to use for creating the ViewModel. Defaults to HasDefaultViewModelProviderFactory.defaultViewModelCreationExtras if the resolved viewModelStoreOwner implements it, otherwise CreationExtras.Empty.