Advanced Topics
The Advanced Topics pages document APIs that build on the core concepts.
- Results β
NavigationKey.WithResult<R>,complete(value)andregisterForNavigationResult. The Results page has three sub-pages for multi-step flows: embedded flows for short callback chains, managed flows for longer or branching sequences, and Flows in a ViewModel for a flow that draws its own UI around the steps. - View Models β
by navigationHandle<MyKey>()inside a ViewModel,createEnroViewModel { }in a Composable, and state shared between destinations. - Animations β
NavigationAnimations, per-element animations, predictive back and shared elements. - Testing β
runEnroTest,EnroTestRule,TestNavigationHandleand the assertion functions. - Plugins β receive a callback when any destination is opened, becomes active or is closed. Used for analytics, telemetry and instance metadata.
- Synthetic Destinations β a
NavigationKeybound to a block of code instead of a screen. Used to call non-Enro APIs, redirect on a runtime condition, and choose between several destinations that return the same result type. - Path Bindings β
@NavigationPathandNavigationPathBindingmap URL paths toNavigationKeys for deep links and web URLs. - Interceptors β run code before an open, close or result, and continue, cancel or replace the operation.
- Deep Links β open a destination from a URL, on Android and the web, with a backstack below the destination.
- Saved State β how long state in
remember,rememberSaveable, a ViewModel andSavedStateHandleis kept. - Dependency Injection β ViewModels created by a DI framework, with Koin and Metro as the examples.
- Multi-Module Projects β feature modules that open screens from other feature modules without a module dependency.
- Scenes β dialogs, overlays, custom scene strategies and scene decorators.