Advanced Examples
Explore advanced usage scenarios for DevView, including custom modules, multi-module integration, and workflows. These examples demonstrate how to extend DevView for complex developer needs.
Custom Module Example
object MyAdvancedModule : Module {
override val moduleName = "Advanced Tool"
override val section = Section.CUSTOM
override val destinations: PersistentMap<KClass<out NavKey>, DestinationMetadata> =
persistentMapOf(MyDestination.Main.withTitle("Advanced Tool"))
override val entryDestination: NavKey = MyDestination.Main
override val registerSerializers: PolymorphicModuleBuilder<NavKey>.() -> Unit = { /* ... */ }
override fun EntryProviderScope<NavKey>.registerContent(
onNavigateBack: () -> Unit,
onNavigate: (NavKey) -> Unit,
bottomPadding: Dp,
) { /* ... */ }
}
val modules = rememberModules {
module(MyAdvancedModule)
module(FeatureFlip)
module(Analytics())
module(NetworkMock(resourceLoader = NetworkMockResourceLoader { path -> Res.readBytes(path) }))
}
Multi-Module Integration
- Register multiple modules in
rememberModules - Use feature flags to enable/disable modules at runtime
- Integrate analytics and network mocking for comprehensive debugging
Workflow Example
- Combine FeatureFlip, Analytics, and NetworkMock for end-to-end testing
- Use custom modules for project-specific developer tools
Troubleshooting
- For complex integrations, ensure all modules are registered and initialised
- Use platform-specific notes for Android/iOS differences
Next Steps
- See Module Development for creating custom modules
- Explore Examples for platform-specific usage
If you encounter issues not covered here, consult the Troubleshooting & FAQ or open an issue on the DevView repository.