Skip to content

Support consuming a plugin without having to write native code #7814

@mit-mit

Description

@mit-mit

Currently the native interop via PlatformMessages requires registering the native endpoint with FlutterView, e.g.:

public class MyActivity extends FlutterActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        new BatteryPlugin(this).installInto(getFlutterView());
    }

This will be cumbersome once we have published plugins that developers can declare a dependency on (#7816). They would have to write native code to 'wire up' the native code that came from the plugin.

Ideally they should just have to declare the dependency in pubspec.yaml, call flutter packages get, and then be ready to call the plugin's Dart interface and have all the wiring handled automagically as part of building/running the app.

Metadata

Metadata

Assignees

Labels

p: toolingAffects the flutter_plugin_tools package

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions