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
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 hasWebViewFlutterAndroidExternalApi(Android) andFWFWebViewFlutterWKWebViewExternalAPI(iOS) classed for accessing the platform WebViews associated with a given handle. Both use either theFlutterPluginRegistryor theFlutterEngine, 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
FlutterPluginRegistrarto allow upward access to theFlutterPluginRegistryAndroid - Add a method to
FlutterPlugin.FlutterPluginBindingto access theFlutterEngine