Register Flutter plugins at runtime
- Dominant language
- Dart
- Stars
- 275
- Forks
- 144
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 47
Description
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 ` 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.
Contributor guide
Assessment
This issue has not been assessed yet.