Overview
Last updated
Was this helpful?
Last updated
Was this helpful?
Provides an easy solution for screen navigation in the Android, eliminating the need to understand the Fragment lifecycle or implement transitions in Compose. Also, supports mixed transitions between Fragments and Compose screens if you are migrating from the Fragments to Compose or have mixed project at all.
Latest release verion:
Project decoupling. Keep the business logic separate from the navigation logic, maintaining a clean architecture.
Easy navigation between screens
Send parameters to the screen you want to navigate to and get a result from its job
Intercept navigation and replace it by a new one if needed. For example signin screen for unathorized users
Opportunity to close a sequence of screens united in a group. For example you have wizard with several steps and you need to close it all once a user completes his journey
Deep links
Happy life
The main idea of Router is to avoid navigation calls like these:
By doing so, you add extra dependencies between screens. Instead, navigation should be handled in a way that the screen only knows it needs to navigate, but not the specifics of how that navigation is performed. This keeps the business logic separate from the navigation logic, maintaining a clean architecture.
You should only call router.route(ScreenPath())
, and the router will handle displaying the screen as it should be shown. It will change the selected tab, close to the screen if it exists in the stack, or present it in full screen.
Navigation between screens
Transfer result between screens
Middleware intercepts navigation between screens, blocking it or replacing it with another navigation
Chain - united sequence of screens