Skip to content

Instantly share code, notes, and snippets.

@Astroa7m
Created October 25, 2022 16:43
Show Gist options
  • Save Astroa7m/6f5cfd3001bef5d2053642d0c4fa8f93 to your computer and use it in GitHub Desktop.
Save Astroa7m/6f5cfd3001bef5d2053642d0c4fa8f93 to your computer and use it in GitHub Desktop.
final Destinations.kt
sealed class Destinations(val route: String) {
object Home : Destinations("home")
object Details : Destinations("details/{userId}") {
fun setAndGetArgumentRoute(id: Int) = route.replace("{userId}", id.toString())
}
// add this
object AddNewUser : Destinations("add_new_user")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment