ViewModelNavStackRecordLocalProvider

A NavStackRecordLocalProvider that provides a LocalViewModelStoreOwner for each record in the back stack.

This allows ViewModel instances to be scoped to the lifecycle of a specific BackStack.Record. It also provides LocalBackStackHostViewModelStoreOwner with the ViewModelStoreOwner of the host of the back stack.

Functions

Link copied to clipboard
open override fun providedValuesFor(record: NavStack.Record): ProvidedValues

Provides LocalViewModelStoreOwner scoped to the given record and LocalBackStackHostViewModelStoreOwner scoped to the host of the back stack.