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

Questions about Plugin Development for flutter-pi #466

Open
kyle-seongwoo-jun opened this issue Jan 5, 2025 · 0 comments
Open

Questions about Plugin Development for flutter-pi #466

kyle-seongwoo-jun opened this issue Jan 5, 2025 · 0 comments

Comments

@kyle-seongwoo-jun
Copy link

kyle-seongwoo-jun commented Jan 5, 2025

Thank you for this amazing project!

I deeply appreciate your efforts in creating and maintaining such an incredible project.


Currently, I am interested in writing plugin code for flutter-pi. This includes both writing new plugins or implementing existing plugins from pub.dev for flutter-pi.

However, I noticed that there isn’t detailed documentation about this topic in the README or the Wiki. I have searched and reviewed related GitHub issues and thought it might be helpful to have this information documented.

From my understanding, there seem to be two main approaches for plugin development:

  1. Writing C code in src/plugins
    I understand this method involves forking the repository, adding the C implementation in the src/plugins directory, building the modified flutter-pi binary, and deploying it to the Raspberry Pi.

  2. Using FFI
    This approach follows C interop using dart:ffi as documented in Dart’s official guidelines.

I’d like to confirm if my understanding is correct.

Assuming it is, I have the following additional questions:

  1. In the case of the first approach, is it possible to use the flutterpi_tool build method (described as the "New Method" in the README), or is this method incompatible?

  2. Is there a way to build C plugin code during the Flutter app build process, without needing to separately build the flutter-pi binary?

  3. (If question 2 is possible) Would it also be feasible to implement a system where plugins for flutter-pi are distributed as pub.dev packages, similar to other custom embedders like Tizen or Sony eLinux?
    a. Tizen plugins
    b. Sony eLinux plugins

  4. If I want to use C++ code for a plugin, is the second approach (FFI) the only viable option?

Thank you for your time and for reading this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant