Skip to content

Instantly share code, notes, and snippets.

@MkhytarMkhoian
Created June 5, 2024 20:23
Show Gist options
  • Save MkhytarMkhoian/4639bed48b6bf911512e4224e50562f9 to your computer and use it in GitHub Desktop.
Save MkhytarMkhoian/4639bed48b6bf911512e4224e50562f9 to your computer and use it in GitHub Desktop.
class AppNavigator(
private val navController: NavController,
) : GlobalAppNavigator {
override fun goFares(ryderId: String) {
navController.navigateSafely(HomeFragmentDirections.actionHomeFragmentToTicketsFlow())
navController.navigateSafely(
RyderListFragmentDirections.actionRydersFragmentToFareListFragment(ryderId = ryderId)
)
}
override fun goToConfirmation(ryderId: String, fareDescription: String, farePrice: Float) {
navController.navigateSafely(
FareListFragmentDirections.actionFareListFragmentToConfirmationFragment(
ryderId = ryderId,
fare = FareModel(
description = fareDescription,
price = farePrice
)
)
)
}
override fun goBack() {
navController.navigateUp()
}
override fun goHome() {
navController.navigateSafely(
MobileNavigationDirections.actionGlobalGoHome()
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment