chanjungskim
02/28/2023, 9:06 AMsurveyToken
here to ResultScreen?
surveyScreen(
moveToResult = { surveyToken ->
navController.navigateToResult(surveyToken)
}
)
And here's the navigateToResult function.
const val resultRoute = "result_route"
fun NavController.navigateToResult(surveyToken: String, navOptions: NavOptions? = null) {
this.navigate("$resultRoute/$SURVEY_TOKEN?=$surveyToken", navOptions)
}
@OptIn(ExperimentalAnimationApi::class)
fun NavGraphBuilder.resultScreen(deviceDisplayState: DeviceDisplayState, moveToOrder: () -> Unit, moveToBack: () -> Unit) {
composable(route = resultRoute) {
ResultRoute(deviceDisplayState, moveToOrder, moveToBack, hiltViewModel(LocalContext.current as MainActivity))
}
}
I get
java.lang.IllegalArgumentException: Navigation destination that matches request NavDeepLinkRequest{ uri=<android-app://androidx.navigation/result_route/survey_token?=711d28d33d0fd880459108da5aeb819fce94948f49bdbed20117a27c7109> } cannot be found in the navigation graph NavGraph(0x0) startDestination={NavGraph(0x22fb6594) route=entry_graph startDestination={Destination(0x2395568f) route=entry_route}}
this error.Divyansh Kushwaha
03/01/2023, 4:16 AMthis.navigate("$resultRoute/$surveyToken", navOptions)