Navigating to Compose destinations
In this section, we will learn how to navigate to a details screen when we click on a pet item in the list. First, we need to create a new composable for PetDetailsScreen
. Let us create a new file called PetDetailsScreen.kt
and create the PetDetailsScreenContent
composable as follows:
@OptIn(ExperimentalLayoutApi::class) @Composable fun PetDetailsScreenContent(modifier: Modifier) { Column( modifier = modifier .fillMaxSize() .padding(16.dp), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally ) { AsyncImage( &...