hi <@U0234N0QYSK> trying to navigate back with res...
# compose-destinations
b
hi @Rafael Costa trying to navigate back with result. Applied serializable but did not work for some reason.
Copy code
@Destination
@Composable
fun AgentOrderWarehouseProductsScreen(
    warehouseId: Long,
    navController: DestinationsNavigator,
    editOrderConfirmationResultRecipient: ResultRecipient<AgentEditOrderConfirmationDialogDestination, DismissEditConfirmationEnum>,
    filterResultRecipient: ResultRecipient<AgentOrderProductsFilterBottomSheetDestination, FilterWarehouseProduct>,
    viewModel: AgentOrderWarehouseProductsViewModel = get()
) {
and
Copy code
import kotlinx.serialization.Serializable

@Serializable
data class FilterWarehouseProduct(
    val productInStock: ProductInStock,
    val productSelectionType: ProductSelectionType
)
destinations:
Copy code
private fun ManualComposableCallsBuilder.agentOrderWarehouseProductsScreenDestination() {
    composable(AgentOrderWarehouseProductsScreenDestination) {
        AgentOrderWarehouseProductsScreen(
            navController = destinationsNavigator,
            warehouseId = navArgs.warehouseId,
            filterResultRecipient = resultRecipient<AgentOrderProductsFilterBottomSheetDestination, FilterWarehouseProduct>(),
            editOrderConfirmationResultRecipient = resultRecipient<AgentEditOrderConfirmationDialogDestination, DismissEditConfirmationEnum>()
        )
    }
}
error: ksp] com.ramcosta.composedestinations.codegen.commons.IllegalDestinationsSetup: Composable AgentOrderWarehouseProductsScreen, FilterWarehouseProduct: Result types must be one of: String, Long, Boolean, Float, Int, Parcelable, Serializable.
Copy code
@Destination(style = DestinationStyleBottomSheet::class)
@Composable
fun AgentOrderProductsFilterBottomSheet(
    productInStock: ProductInStock,
    productSelectionType: ProductSelectionType,
    resultBackNavigator: ResultBackNavigator<FilterWarehouseProduct>
) {
and
Copy code
private fun ManualComposableCallsBuilder.agentFilterOrderBottomSheetDestination() {
    bottomSheetComposable(AgentOrderProductsFilterBottomSheetDestination) {
        AgentOrderProductsFilterBottomSheet(
            productInStock = navArgs.productInStock,
            productSelectionType = navArgs.productSelectionType,
            resultBackNavigator = resultBackNavigator()
        )
    }
}
initially it was not data class but pair, tried to change it to data class but not fixed. it stopped working after I updated to the latest version. raamcostaNavitagion = "1.11.7" it used to be "1.8.33-beta". it is interesting to note that when I tried with @Parcelize it worked but here I cannot do it since FilterWarehouseProduct is in commonMain. I need that data class in Swift Ui
r
Hi 👋 Seems like this version still doesn’t support Kotlinx serializable result classes. Note that the error mentions Serializable but it means the Java.Serializable. The curious thing is that you said it used to work, which I don’t think can be right 😅
Only v2 supports this.
In this release notes you’ll find info about it
b
yeah, it definetely used to work, but it was not data class but Pair<Enum,Enum>
r
Yeah than if the situation was different, well then it was different 😁
😅 1
But with current result types you have here, only v2 will work
b
I see, thanks