dart-lang / dart-lang/native

Register Flutter plugins at runtime

Open
#1,022 0 comments 0 reactions 0 assignees View on GitHub
package:jni package:jnigen
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.