ComponentKeyUtils

Functions

Link copied to clipboard
fun formatKeySegment(key: String, idToTypeMap: Map<Int, Any>): String

Maps a key segment (e.g. "3") to a human-readable simple name using a reverse lookup map (id -> type) for O(1) lookup.

Link copied to clipboard
fun generateGlobalKey(parentContext: ComponentContext, parentComponent: Component?, childComponent: Component): GlobalKey

Generate a global key for the given component that is unique among all of this component's children of the same type. If a manual key has been set on the child component using the .key() method, return the manual key.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getKeyWithSeparator(vararg keyParts: Any): String
fun getKeyWithSeparator(parentGlobalKey: String, key: String): String
Link copied to clipboard
Link copied to clipboard
fun parentNameFromKey(globalKey: GlobalKey?, idToTypeMap: Map<Int, Any>): String?

Extracts the parent component's simple name directly from a GlobalKey.