Pablo
12/28/2024, 2:21 PMdesktopMain
and which inside commonMain
? I'm developing an app for Compose Desktop with Room, Retrofit, Koin, etc... and after a lot of research, tutorials and help here, I now have almost all the content inside commonMain
, let's say 99%. The only kotlin code I have in my desktopMain
module is more or less this:
fun main() = application {
[...]
Window(
onCloseRequest = ::exitApplication,
title = stringResource(Res.string.app_name),
state = windowState
) {
MyApplicationTheme {
App()
}
}
}
But then... what should I put inside desktopMain
? For example... now I'm adding a MenuBar
in the upper part of the window, and that seems to be a desktop only component... but I can't add it on the desktopMain
module because the composables, navigation etc... and all UI stuff is on commonMain
. So... what to do here? If I create a composable for the MenuBar
on desktopMain
, that composable should trigger navigation and stuff on viewmodels placed on the commonMain
module, so I don't know how to link them.jw
12/28/2024, 2:45 PMjw
12/28/2024, 2:46 PMjw
12/28/2024, 2:46 PMPablo
12/28/2024, 2:49 PMPablo
12/28/2024, 2:49 PMPablo
12/28/2024, 2:49 PMjw
12/28/2024, 2:50 PMPablo
12/28/2024, 2:50 PMjw
12/28/2024, 2:50 PMPablo
12/28/2024, 2:50 PMPablo
12/28/2024, 2:51 PMjw
12/28/2024, 2:56 PMPablo
12/28/2024, 3:01 PMPablo
12/28/2024, 3:02 PMPablo
12/28/2024, 3:02 PMdesktopMain (main.kt) simply showing App.kt, and the MenuBar
commonMain (App.kt) ui, navigation...
Pablo
12/28/2024, 3:03 PMPablo
12/28/2024, 3:03 PMPablo
12/28/2024, 3:03 PMjw
12/28/2024, 3:59 PMMark
12/30/2024, 3:33 AMPablo
12/30/2024, 7:50 AMPablo
12/30/2024, 7:52 AMCould not find Navigator with class "class androidx.navigation.compose.ComposeNavigator". You must call NavController.addNavigator() for each navigation type.
Pablo
12/30/2024, 7:53 AMPablo
12/30/2024, 7:55 AM