NavEaseNavGraph

fun NavEaseNavGraph(initialScreen: NavKey, savedStateConfig: SavedStateConfiguration, screenFactory: (NavKey) -> NavScreen, onExitRequest: () -> Unit = {}, enableSharedTransitions: Boolean = false, navTransition: NavTransition = NavTransition.Push)

Core navigation host composable — KSP / legacy variant.

Accepts the classic (NavKey) -> NavScreen factory produced by KSP or written by hand. Prefer the NavEaseGraph overload for new projects — it requires no code generation and has zero rebuild friction.

Parameters

initialScreen

The first screen placed on the back stack.

savedStateConfig

Serialization config for back-stack state restoration.

screenFactory

Maps a NavKey to its NavScreen. Typically KSP-generated.

onExitRequest

Called when back is pressed at the root screen. No-op by default.

enableSharedTransitions

When true, wraps in SharedTransitionLayout.

navTransition

Default screen-transition animation. Defaults to NavTransition.Push.


fun NavEaseNavGraph(graph: NavEaseGraph, onExitRequest: () -> Unit = {}, enableSharedTransitions: Boolean = false, navTransition: NavTransition = NavTransition.Push)

Core navigation host composable — zero-rebuild DSL variant.

Accepts a NavEaseGraph built with navEaseGraph. No code generation, no KSP, no rebuild required after adding a new screen.

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

// In your root composable:
NavEaseNavGraph(appGraph)

Parameters

graph

The navigation graph built via navEaseGraph.

onExitRequest

Called when back is pressed at the root screen. No-op by default.

enableSharedTransitions

When true, wraps in SharedTransitionLayout.

navTransition

Default screen-transition animation. Defaults to NavTransition.Push.