-
-
Notifications
You must be signed in to change notification settings - Fork 173
Guidance on writing new plugins #47
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
Comments
Exactly, a flutter-pi plugin is just:
It's also "convention" to implement a flag, like
So, in practice, you'll have to add 6 lines to // my_plugin.h should contain the definitions of `my_plugin_init`
// and `my_plugin_deinit`
#ifdef BUILD_MY_PLUGIN
# include <plugins/my_plugin.h>
#endif
// . . .
struct flutterpi_plugin hardcoded_plugins[] = {
// . . . the other plugins' registrations here
#ifdef BUILD_MY_PLUGIN
{.name = "my_plugin", .init = my_plugin_init, .deinit = my_plugin_deinit},
#endif
}; Then you need to update the
|
Perfect, works! Thanks, closing... |
What is the recommended approach to writing new plugins for flutter-pi?
Looking at the gpiod plugin, it looks like a dart package (no native code) combined with a gpiod.c file in the plugins folder.
What are the steps necessary to link and build the .c file and make flutter-pi aware of new plugins?
The text was updated successfully, but these errors were encountered: