klutter icon indicating copy to clipboard operation
klutter copied to clipboard

Compose Multiplatform UI View in Flutter

Open Legion2 opened this issue 2 years ago • 10 comments

Is it possible to use Compose Multiplatform UI in Flutter?

Legion2 avatar Nov 09 '23 10:11 Legion2

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

buijs-dev avatar Nov 09 '23 18:11 buijs-dev

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.

Legion2 avatar Nov 09 '23 18:11 Legion2

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?

buijs-dev avatar Nov 09 '23 19:11 buijs-dev

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.

Legion2 avatar Nov 09 '23 19:11 Legion2

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

buijs-dev avatar Nov 09 '23 19:11 buijs-dev

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.

Legion2 avatar Nov 09 '23 19:11 Legion2

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. 😉

buijs-dev avatar Nov 09 '23 20:11 buijs-dev

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

blackwiz4rd avatar Nov 28 '23 20:11 blackwiz4rd

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

Legion2 avatar Apr 27 '24 10:04 Legion2

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.

buijs-dev avatar Apr 27 '24 11:04 buijs-dev