-
Notifications
You must be signed in to change notification settings - Fork 0
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
convert to Flutter plugin package #1
Comments
Oh I saw this now. I was saying the same thing. Although, if you use the plugin format, then you can still use the FFI (although its not easy). And thus, the thing can be cross platform. |
@alexmercerind yes this is the main annoyance I can see so far in that there is no good way to publish dynamic platform libraries in a pure Dart pub package. Also per your other comment, I'm not sure I understand what you mean you can't run CMake for plain Dart files? Sure its not part of standard build process as it is for example for Android apps but there is nothing stopping you having that as part of your packages build process, for example using a Grinder script. |
Hi there @maks ! Yes, those async callbacks are using
I meant like when the Dart library is distributed as a plugin, it executes a CMake script to get the plugin's C++ code ready & compiled to be linked with the app. But in case of a plain Dart or a simple package, there is no starting point to run a CMake script after a Dart/Flutter developer installs the package. The developer then, himself has to run the CMakeLists to get its dependencies (headers, libs & dlls) ready, which a plugin does out of the box. So, changing to plugin is the good solution, by that you can setup FFI things (if you wish). |
@alexmercerind I think I can help with that, these ports are the same SendPort mechanism used within Dart to communicate between Isolates, so there is really no limitation to what data can be sent. The only limitation is really to do with performance, especially deserialisation on the Dart side, but thats exactly the same problem people face at the moment shipping large amounts of data between Main and worker Isolates. Its also something the Dart team are working on addressing soon too with sendAndExit functionality, though I'm not sure if that will be able to be used for this. With CMake, thats exactly what I meant in when I created this issue, at the moment, the package developer needs to ship prebuilt binaries of the the dynamic library the package uses if the package uses it's own library, versus a system installed one, eg. on my linux system, alsa is available at |
Given there is no good solution at the moment for distributing packages with dynamic libs using FFI the easiest thing to do for now is to convert this into a Flutter plugin package for which there is documentation on how to distribute dynamic libs in the package.
The text was updated successfully, but these errors were encountered: