presentation-core-navigation-api¶
This module defines the navigation contracts and destinations for the "kite-aos" project.
Features¶
- AppNavigator: An abstract interface for performing navigation actions, supporting modes like single-top and task clearing.
- Destinations: Strongly-typed destinations (using
Destinationsealed class) for all major application screens, defined asdata objects. - CompositionLocals: Easy access to the navigator and back actions throughout the Compose tree via
LocalAppNavigatorandLocalBackAction.
Usage¶
Navigating¶
To navigate from a Composable, obtain the AppNavigator from LocalAppNavigator:
val navigator = LocalAppNavigator.current
// Basic navigation
navigator?.navigate(Destination.Settings)
// Navigation with options
navigator?.navigate(Destination.Main, AppNavigator.NavOptions.ClearTask)
Back Action¶
You can use popBackStack() or the legacy backAction():