@file:Suppress("MatchingDeclarationName") package composegears.tiamat.example import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.material3.Button import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.composegears.tiamat.freeArgs import com.composegears.tiamat.navController import com.composegears.tiamat.navDestination import composegears.tiamat.example.ui.core.BackButton import composegears.tiamat.example.ui.core.SimpleScreen import composegears.tiamat.example.ui.core.webPathExtension class FreeArgsData val DataPassingFreeArgsRoot by navDestination(webPathExtension()) { val navController = navController() SimpleScreen("Data passing: free args") { Column( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(16.dp) ) { Button({ navController.navigate(DataPassingFreeArgsScreen, freeArgs = 1) }) { Text("Pass `Int` to next screen") } Button({ navController.navigate(DataPassingFreeArgsScreen, freeArgs = 1f) }) { Text("Pass `Float` to next screen") } Button({ navController.navigate(DataPassingFreeArgsScreen, freeArgs = "String") }) { Text("Pass `String` to next screen") } Button({ navController.navigate(DataPassingFreeArgsScreen, freeArgs = FreeArgsData()) }) { Text("Pass `Class` to next screen") } } } } val DataPassingFreeArgsScreen by navDestination { val navController = navController() val args = freeArgs() SimpleScreen("Data passing: free args - args") { Column( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier.padding(16.dp) ) { Text(text = "Received free args data: $args", style = MaterialTheme.typography.bodyMedium) BackButton(onClick = { navController.back() }) } } }