buijs-dev / klutter

Framework for Flutter + Kotlin Multiplatform
MIT License
225 stars 5 forks source link

Compose Multiplatform UI View in Flutter #26

Open Legion2 opened 10 months ago

Legion2 commented 10 months ago

Is it possible to use Compose Multiplatform UI in Flutter?

buijs-dev commented 10 months ago

Technically it would be possible but the question is why...?

Legion2 commented 10 months ago

Our library (SDK) is completely written in Kotlin and uses Compose Multiplatform to provide complex UI, which is the main focus of our library. Currently we can use the platform native wrapper to expose the UI to android and iOS separately. But it would be much easier to directly expose the UI from common code to flutter instead of writing glue code for Android and iOS.

buijs-dev commented 10 months ago

Hm that's definitely an interesting challenge. I can look into it but currently I have very little time and I still need to finish a few things for the coming release.

Would it be possible to create a minimal example of your project that I can tinker with?

Legion2 commented 10 months ago

No hurry, this was only an idea and your library is already a great help 👍. Unfortunately our library is closed source but there are official Compose Multiplatform demo projects which can be used for testing.

buijs-dev commented 10 months ago

Out of curiosity, are you using Klutter in a production level app?

Legion2 commented 10 months ago

Not jet, but we are considering using it in our production SDK if the manual mapping becomes unfeasible to maintain. But the flutter binding has low priority for us and we have other bindings with higher priority.

buijs-dev commented 10 months ago

Cool! Please let me know if you decide to use Klutter in production. And if you need more structural help on your project, I do freelance work. 😉

blackwiz4rd commented 10 months ago

Theoretically this is possible, because kotlin has interoperability with swift: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-ios-ui-integration.html#use-compose-multiplatform-inside-a-swiftui-application

Legion2 commented 5 months ago

Our priorities shifted and we may start working on this soon.

buijs-dev commented 5 months ago

I'm working on the 2024 release which supports protobuf. Also refactoring the dart components to make it more reliable and easier to use. Could start work on this after that.