Package-level declarations

Types

Link copied to clipboard
data class ComposeRouteTransition(val enter: AnimatedContentTransitionScope<RouteStackEntry>.(density: Density) -> EnterTransition, val exit: AnimatedContentTransitionScope<RouteStackEntry>.(density: Density) -> ExitTransition, val popEnter: AnimatedContentTransitionScope<RouteStackEntry>.(density: Density) -> EnterTransition, val popExit: AnimatedContentTransitionScope<RouteStackEntry>.(density: Density) -> ExitTransition) : IRouteTransition

ComposeRouteTransition defines a route transition

Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T : Any> getKClassForGenericType(): KClass<T>

This is a workaround for a Kotlin Kmp compiler bug for iOS. Using @Composable while trying to access a reified generic type throws a compilation error: (Generation of stubs for class org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterPublicSymbolImpl is not supported yet) https://github.com/JetBrains/compose-multiplatform/issues/3147

Link copied to clipboard
actual fun KmpBackHandler(enabled: Boolean, onBack: () -> Unit)
expect fun KmpBackHandler(enabled: Boolean, onBack: () -> Unit)
actual fun KmpBackHandler(enabled: Boolean, onBack: () -> Unit)
actual fun KmpBackHandler(enabled: Boolean, onBack: () -> Unit)
actual fun KmpBackHandler(enabled: Boolean, onBack: () -> Unit)
Link copied to clipboard
inline fun <T : Any> rememberForRoute(key: String? = null, noinline factory: IRememberForRouteScope.() -> T): T
fun <T : Any> rememberForRoute(objectType: KClass<T>, key: String? = null, factory: IRememberForRouteScope.() -> T): T

rememberForRoute Remembers a given object for the lifetime of the route. There may only be one instance of a given class for a given route. Additional instances may be created if a constant and unique key is provided. Nullable types have undefined behaviour.

Link copied to clipboard
fun RouteDestroyedEffect(effectId: String, effect: () -> Unit)

RouteDestroyedEffect runs only once when the IRoute is popped off the backstack. If the route the effect is attached to is currently visible in the composition, the effect will not be run until the composable has been disposed

Link copied to clipboard
fun RouteSwitch(coordinator: Coordinator, content: @Composable (route: IRoute) -> Unit)

Observes a Coordinator and switches out content based on the current route.

fun RouteSwitch(coordinatorObserver: ICoordinatorObserver, content: @Composable (route: IRoute) -> Unit)

Observes an ICoordinatorObserver and switches out content based on the current route.

fun RouteSwitch(router: IRouter, content: @Composable (route: IRoute) -> Unit)

Observes an IRouter and switches out content based on the current route.

Link copied to clipboard
fun routeTransition(transition: IRouteTransition): IAnimatedRoute

routeTransition is a convenience delegate function to help implement IAnimatedRoute