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

Register Flutter plugins at runtime #1022

Open
Tracked by #1023
HosseinYousefi opened this issue Mar 17, 2024 · 0 comments
Open
Tracked by #1023

Register Flutter plugins at runtime #1022

HosseinYousefi opened this issue Mar 17, 2024 · 0 comments

Comments

@HosseinYousefi
Copy link
Member

HosseinYousefi commented Mar 17, 2024

Add the ability to register any object of type FlutterPlugin and ActivityAware in JniPlugin.

We can then use JniPlugin.registerFlutterPlugin to add an implementation of FlutterPlugin that calls its onAttachedToEngine and other methods at the right time.

Note

This could be further simplified to require something like <T extends FlutterPlugin & ActivityAware> JniPlugin.register(T plugin) however we don't yet support intersection types and implementing multiple interfaces – #1021. Alternatively we could create a interface ActivityAwareFlutterPlugin implements FlutterPlugin, ActivityAware and include it.

We might decide to expose the bindings in another package, for example package:flutter_jni, however the Java code must still reside in package:jni until we stop depending on Flutter and use the native assets system – #645.

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

No branches or pull requests

1 participant