Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Platform View creation #21

Open
lalomartins opened this issue Jul 26, 2023 · 2 comments
Open

Support Platform View creation #21

lalomartins opened this issue Jul 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@lalomartins
Copy link

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
Copy link
Author

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

@buijs-dev
Copy link
Owner

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 buijs-dev added the enhancement New feature or request label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants