any guide about how to setup and use Koin with Com...
# compose-desktop
p
any guide about how to setup and use Koin with Compose Desktop? I only find guides for KMP Android/IOS
k
there is no difference. it is kotlin common library
p
Well there is something I'm missing. I create a module with this class
Copy code
class JVMPlatform {
    val name: String = "Java ${System.getProperty("java.version")}"
}

val appModule = module {
    single<JVMPlatform> {JVMPlatform()}
}
I added koin the project following Koin documentation:
Copy code
@Composable
fun App() {
    MaterialTheme {
        KoinApplication(application = {
            modules(
                appModule
            )
        }) {
            KoinContext() {
                WelcomeScreen()
            }
        }
    }
}
And when trying to inject the variable of type JVMPlatform I cannot figure out how to do it:
Copy code
val myVariable: JVMPlatform = get()
That gives this error:
Type mismatch. Required:JVMPlatform Found:Koin
well I solved it using koinInject
Copy code
val greetingDI: Greeting = koinInject<Greeting>()
but now, I'm getting this exception when launching the app:
KoinApplication has not been started
the error is being thrown on the line
Copy code
KoinContext() {
if I remove KoinContext() then it works
k
#C67HDJZ2N
p
oh, didn't know that channel, thanks