klutter icon indicating copy to clipboard operation
klutter copied to clipboard

Support Platform View creation

Open lalomartins opened this issue 2 years ago • 2 comments

https://docs.flutter.dev/platform-integration/ios/platform-views

I have to write a plugin to wrap a native library and, for reasons not easily avoidable, that includes writing a Platform View. It would be nice if I was able to do that in Klutter. AIUI it's mainly a matter of exposing the FlutterPlatformView and FlutterPlatformViewFactory classes in the Kotlin API? And then more importantly, automagically handling registration. Of course if you want to make it even fancier and generate the factory too, nobody will complain.

Caveats: I believe platform views only exist for Android and iOS. Not sure what Klutter would do in this case when building for other platforms.

lalomartins avatar Jul 26 '23 05:07 lalomartins

I'm not sure it's even possible, just throwing it out there...

lalomartins avatar Jul 26 '23 06:07 lalomartins

Interesting idea. Everything is possible of course. The main thing would be to expose FlutterPlatformView(Factory) in Kotlin. I'm not sure if that's doable. I had a lot of issues wrapping Event-channel Flutter code in Kotlin Multiplatform. To make it work is one thing but to maintain it is another.

buijs-dev avatar Jul 26 '23 20:07 buijs-dev