Skip to content

Instantly share code, notes, and snippets.

@neugartf
Last active May 15, 2021 13:24
Show Gist options
  • Save neugartf/99bcf0cb267db65d56c02dd99584b784 to your computer and use it in GitHub Desktop.
Save neugartf/99bcf0cb267db65d56c02dd99584b784 to your computer and use it in GitHub Desktop.
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