ScreensNavigation

actual fun ScreensNavigation(startRoute: String, enterTransition: AnimatedContentTransitionScope<*>.() -> EnterTransition, exitTransition: AnimatedContentTransitionScope<*>.() -> ExitTransition, popEnterTransition: AnimatedContentTransitionScope<*>.() -> EnterTransition, popExitTransition: AnimatedContentTransitionScope<*>.() -> ExitTransition, builder: ScreensMapBuilder.() -> Unit)
expect fun ScreensNavigation(startRoute: String, enterTransition: AnimatedContentTransitionScope<*>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }, exitTransition: AnimatedContentTransitionScope<*>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }, popEnterTransition: AnimatedContentTransitionScope<*>.() -> EnterTransition = enterTransition, popExitTransition: AnimatedContentTransitionScope<*>.() -> ExitTransition = exitTransition, builder: ScreensMapBuilder.() -> Unit)

Defines screens navigation map by declaring all possible screens and their contents identified by their routes.

It's later provided via compositionLocalOf to allow navigation to another screen within currently presented screen.

Has separate implementations for Android and non Android targets.

Android target underneath uses official Compose Navigation framework made by Google. Android implementation utilizes optional route arguments and JSON serialization via Kotlin Serialization.

Other targets have common custom implementation that does not involve any serialization.

Parameters

startRoute

first screen route for which the initial screen will be displayed

enterTransition

defines enter transitions when pushing new screen on the stack, by default uses fade in animation

exitTransition

defines exit transitions when pushing new screen on the stack by default uses fade out animation

popEnterTransition

defines enter transitions when popping screen from the stack by default uses animation specified in enterTransition

popExitTransition

defines exit transitions when popping screen from the stack by default uses animation specified in exitTransition

builder

the builder used to construct the underlying screens navigation map

See also

actual fun ScreensNavigation(startRoute: String, enterTransition: AnimatedContentTransitionScope<*>.() -> EnterTransition, exitTransition: AnimatedContentTransitionScope<*>.() -> ExitTransition, popEnterTransition: AnimatedContentTransitionScope<*>.() -> EnterTransition, popExitTransition: AnimatedContentTransitionScope<*>.() -> ExitTransition, builder: ScreensMapBuilder.() -> Unit)