Last active
June 9, 2025 22:40
-
-
Save igorescodro/dfafcec2c882f5891889180a20e13769 to your computer and use it in GitHub Desktop.
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
// Event.kt | |
sealed interface Event { | |
fun nextDestination(): Destination | |
data object OnBack : Event { | |
override fun nextDestination(): Destination = Destination.Back | |
} | |
} | |
// ShoppingEvent.kt | |
object PreferenceEvent { | |
data class OnItemClick(itemId: String) : Event { | |
override fun nextDestination(): Destination = ShoppingDestination.Details(itemId = itemId) | |
} | |
data object OnCartClick : Event { | |
override fun nextDestination(): Destination = ShoppingDestination.Cart | |
} | |
data object OnCheckoutClick : Event { | |
override fun nextDestination(): Destination = ShoppingDestination.Payment | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment