screen

inline fun <K : NavKey> screen(noinline content: @Composable (K) -> Unit)

Registers a NavKey subclass K with its composable screen content.

The content lambda receives the typed key so route arguments are accessible directly:

screen<AppScreen.Home> { HomeScreen() }
screen<AppScreen.Detail> { key -> DetailScreen(id = key.id) }

Inside content, use io.github.alimsrepo.navease.runtime.composition.LocalNavEaseController to access the io.github.alimsrepo.navease.runtime.navigation.NavEaseController:

val nav = LocalNavEaseController.current
nav.navigate(AppScreen.Detail(id = "xyz"))

Type Parameters

K

The NavKey subclass for this screen. Must be annotated with @Serializable.