getOrCreateViewModel
fun <T : ViewModel> getOrCreateViewModel(owner: ViewModelStoreOwner, kotlinClass: KClass<*>, key: String? = null, factory: ViewModelProvider.Factory? = null): T
Returns an existing ViewModel from the ViewModelStore owned by the ViewModelStoreOwner. If no existing ViewModel is in the store it creates a new one using a factory provided in factory. If factory is null
a factory will be retrieved by calling HasDefaultViewModelProviderFactory.defaultViewModelProviderFactory on the ViewModelStoreOwner or a default factory will be used expecting a parameter-less constructor for kotlinClass.