How to use custom navigation inside an extension
mainSince the content property of an InspektifyExtension is a standard @Composable slot, you can host your own navigation library (such as Jetpack Navigation, Voyager, or Decompose) inside the extension detail screen. This is the recommended approach for extensions requiring multiple screens.
Limitations:
- Inspektify controls the detail screen's top bar (title and back action).
- The system back action is hardcoded to navigate back to Inspektify's outer navigation.
- Customizing the top bar per subscreen or coordinating the system back action with an inner navigator is not currently supported.
InspektifyExtensions.register(
InspektifyExtension(
id = "feature-flags",
title = "Feature flags",
content = {
val navController = rememberNavController()
NavHost(navController = navController, startDestination = "list") {
composable("list") { FlagListScreen(onOpenDetail = { navController.navigate("detail/$it") }) }
composable("detail/{flag}") { FlagDetailScreen(/* ... */) }
}
}
)
)