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 implementing ObjC protocols from Dart #1040

Open
liamappelbe opened this issue Mar 22, 2024 · 5 comments · May be fixed by #1175
Open

Support implementing ObjC protocols from Dart #1040

liamappelbe opened this issue Mar 22, 2024 · 5 comments · May be fixed by #1175

Comments

@liamappelbe
Copy link
Contributor

This should be possible with a single static piece of native code that can live in package:objective_c, so we won't have to generate different native code for each protocol.

@liamappelbe
Copy link
Contributor Author

The fix for #835 is going to involve ffigen generating ObjC code for each block that the user needs. So there's not really any reason to try to avoid having ffigen generate native code anymore. It will be simpler and more efficient to just generate ObjC and Dart bindings for each interface that we want to implement from Dart, rather than having a generic thing like NSProxy that lives in package:objective_c.

@dcharkes
Copy link
Collaborator

dcharkes commented May 3, 2024

The fix for #835 is going to involve ffigen generating ObjC code for each block that the user needs.

How would we solve the bundling of that ObjC code? Am I correct in assuming that if it's a Flutter plugin I presume we write cocoapods code to include it, and if we use native assets, we'd need to have a ObjectiveCCodeAsset as output from hook/build.dart?

@dcharkes
Copy link
Collaborator

dcharkes commented May 3, 2024

Or can the Objective C just be compiled to a dylib and we can output it as a NativeCodeAsset @liamappelbe ?

@liamappelbe
Copy link
Contributor Author

I'm not sure what the difference is between ObjectiveCCodeAsset and NativeCodeAsset, but the code can be bundled as an ordinary dylib.

@dcharkes
Copy link
Collaborator

dcharkes commented May 6, 2024

I'm not sure what the difference is between ObjectiveCCodeAsset and NativeCodeAsset, but the code can be bundled as an ordinary dylib.

👍 Then we don't need an ObjectiveCCodeAsset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

2 participants