ViewModelStoreNavEntryDecorator


public static class ViewModelStoreNavEntryDecorator


Provides the content of a NavEntry with a ViewModelStoreOwner and provides that ViewModelStoreOwner as a LocalViewModelStoreOwner so that it is available within the content.

This requires that usage of the SavedStateNavEntryDecorator to ensure that the NavEntry scoped ViewModels can properly provide access to SavedStateHandles

Summary

Public methods

void
@Composable
DecorateBackStack(
    @NonNull List<@NonNull Object> backStack,
    @Composable @NonNull Function0<Unit> content
)
void

Public fields

INSTANCE

Added in 1.0.0-alpha01
public static @NonNull ViewModelStoreNavEntryDecorator INSTANCE

Public methods

DecorateBackStack

@Composable
public void DecorateBackStack(
    @NonNull List<@NonNull Object> backStack,
    @Composable @NonNull Function0<Unit> content
)
@Composable
public void <T extends Object> DecorateEntry(
    @NonNull <Error class: unknown class><@NonNull T> entry
)