Created
October 28, 2024 18:21
-
-
Save JakubNeukirch/bbe417e2b71ca4aed05a49e3b9615bfe to your computer and use it in GitHub Desktop.
Navigation in Kotlin Multiplatform with Compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class DetailRoute( | |
private val index: Int | |
): Route() { | |
@Composable | |
override fun Content(controller: NavigationController) { | |
DetailPage(controller, index) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Base `Route` class - you can provide parameters to constructor, and define the screen to be displayed for this route. | |
*/ | |
open class Route { | |
@Composable | |
open fun Content(controller: NavigationController) { | |
} | |
override fun toString(): String { | |
return "${this::class.simpleName}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment