Ahmet Özcan
05/17/2024, 2:33 PM@Serializable
data object TodoListDestination: Destination {
var returnValue: String? = null
}
val controller = rememberNavController()
controller.popBackStack(
route = TodoListDestination.apply { returnValue = "Result" },
inclusive = false,
)
Ian Lake
05/18/2024, 2:32 AMvar
within an object is just a global variable, you're not "returning a result" at all, just building a dependency on global variable that isn't even composition aware (it just happens to work because the other screen isn't being composed when you set the variable - it wouldn't work at all if it was a Dialog destination, for instance, unless something else were to cause a chance recomposition)Ahmet Özcan
05/19/2024, 5:37 PM