Last active
May 15, 2021 13:24
-
-
Save neugartf/99bcf0cb267db65d56c02dd99584b784 to your computer and use it in GitHub Desktop.
This file contains 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
sealed class Routes { | |
abstract val route: String | |
object AddBooks : Routes() { | |
override val route = "addBooks" | |
} | |
object AddMovies : Routes() { | |
override val route = "addMovies" | |
} | |
object Login : Routes() { | |
override val route = "login" | |
} | |
// Subgraph for bottom bar | |
sealed class HomeRoutes(override val route: String) : Routes() { | |
// Workaround to be able to have the "home" route | |
companion object Home { | |
const val route = "home" | |
} | |
object Books : HomeRoutes("home") { | |
override val route = super.route + "/" + "books" | |
} | |
object Movies : HomeRoutes("home") { | |
override val route = super.route + "/" + "movies" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment