Pablo
08/21/2024, 6:07 PMif (currentSectionId != startSection.toInt()){
navController.navigate(currentSectionId.toString())
Log.d("XXXX", "new section: $currentSectionId")
}
Pablo
08/21/2024, 6:12 PM@Composable
fun ApplicationNavHost(
currentSectionId: Int,
modifier: Modifier = Modifier,
navController: NavHostController = rememberNavController()
) {
val sections = SectionHolder.sections
val startSection = SectionHolder.startSection
NavHost(
navController = navController,
startDestination = startSection.toString(),
modifier = modifier
) {
for ((i, section) in sections.withIndex()) {
Log.d("XXXX", "added route: $i")
composable(route = i.toString()) {
SectionComposableFactory(
section = section,
)
}
}
}
if (currentSectionId != startSection.toInt()){
navController.navigate(currentSectionId.toString())
Log.d("XXXX", "new section: $currentSectionId")
}
}