Passing arguments to destinations
In our PetDetailsScreen, we need to remove the hardcoded cat IDs and tags and pass them from the PetList composable. Follow these steps:
- Let us head over to the
PetDetailsScreenContentcomposable inside thePetDetailsScreen.ktfile and modify it as follows:@OptIn(ExperimentalLayoutApi::class) @Composable fun PetDetailsScreenContent(modifier: Modifier, cat: Cat) { Column( modifier = modifier .fillMaxSize() .padding(16.dp), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally ) { AsyncImage( ...