I'm currently building a Plugin to make use of native API's on Android and iOS.
I've written MyPlugin which implements MethodCallHandler. In my plugin project, I have an example app. This example app has a generated class GeneratedPluginRegistrant.class, which calls the static method registerWith. All of this is used as a one liner in the MainActivity.
I have several questions.
It seems that
MyPluginmust match the name of the plugin project. IE - project isflutter_tools, my plugin must be namedFlutterToolsPlugin, otherwiseGeneratedPluginRegistrantwill break. How isGeneratedPluginRegistrantgenerated?What is the purpose of
GeneratedPluginRegistrant?What is actually happening to my plugin when it is registered?
If I want to use
MyPlugin, can it be done so without theGeneratedPluginRegistrant? I wish to respond to lifecycle methods likeonActivityResult, and it seems this encapsulation prevents me from interacting with the plugin directly in theFlutterActivity.Can I interact with other native plugins from my own on the native side without having to go back and forth through Dart?