All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.blucky8649.decompose_navhost.navigation.NavOptions.kt Maven / Gradle / Ivy

Go to download

A Decompose extension library which facilitate writing Jetpack based navigation style code for Compose Multiplatform.

There is a newer version: 1.0.0-alpha04
Show newest version
package com.blucky8649.decompose_navhost.navigation

data class NavOptions(
    private var _popUpToRoute: String = "",
    private var _inclusive: Boolean = false
) {
    val popUpToRoute get() = _popUpToRoute
    val inclusive get() = _inclusive
}

class NavOptionsBuilder {
    private var popUpToRoute = ""
    private var inclusive = false

    fun popUpTo(
        route: String,
        popUpToBuilder: PopUpToBuilder.() -> Unit
    ) {
        val builder = PopUpToBuilder().apply(popUpToBuilder)
        popUpToRoute = route
        inclusive = builder.inclusive
    }

    fun build() = NavOptions(popUpToRoute, inclusive)
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy