NavEntry

class NavEntry<T : Any>(key: T, val contentKey: Any = defaultContentKey(key), val metadata: Map<String, Any> = emptyMap(), content: @Composable (T) -> Unit)

Entry maintains and stores the key and the content represented by that key. Entries should be created as part of a reference/androidx/navigation/NavDisplay.

Parameters

key

key for this entry

contentKey

A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any NavEntryDecorator states associated with this NavEntry.

NavEntries that share the same contentKey will be handled as sharing the same content and/or
[NavEntryDecorator] state. To maximize stability, it should be derived from the [key]. The
contentKey type must be saveable (i.e. on Android, it should be saveable via Android).
Defaults to [key].toString().
metadata

provides information to the display

content

content for this entry to be displayed when this entry is active

Type Parameters

T

the type of the key for this NavEntry

Constructors

Link copied to clipboard
constructor(key: T, contentKey: Any = defaultContentKey(key), metadata: Map<String, Any> = emptyMap(), content: @Composable (T) -> Unit)
constructor(navEntry: NavEntry<T>, content: @Composable (T) -> Unit)

NavEntry constructor to create a NavEntry from another NavEntry

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String