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
PetDetailsScreenContent
composable inside thePetDetailsScreen.kt
file 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( ...