Skip to content

Allow plugins to access published plugin values via the plugin registrar/binding #121527

Description

@fuzzybinary

Use case

When developing a plugin, or writing other native code, it is sometimes necessary to access the native implementation of another plugin. A good example of this is webview_flutter, which has WebViewFlutterAndroidExternalApi (Android) and FWFWebViewFlutterWKWebViewExternalAPI (iOS) classed for accessing the platform WebViews associated with a given handle. Both use either the FlutterPluginRegistry or the FlutterEngine, neither of which are easily accessible from a Plugin.

Proposal

In my mind, the simplest solution that will have the smallest impact is to add properties onto the objects that are already passed to plugins during initialization.

iOS - Add a method to FlutterPluginRegistrar to allow upward access to the FlutterPluginRegistry

Android - Add a method to FlutterPlugin.FlutterPluginBinding to access the FlutterEngine

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: pluginsSupport for writing, building, and running plugin packagesengineflutter/engine related. See also e: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions