Class FlutterPlugin.FlutterPluginBinding

java.lang.Object
io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding
Enclosing interface:
FlutterPlugin

public static class FlutterPlugin.FlutterPluginBinding extends Object
Resources made available to all plugins registered with a given FlutterEngine.

The provided BinaryMessenger can be used to communicate with Dart code running in the Flutter context associated with this plugin binding.

Plugins that need to respond to Lifecycle events should implement the additional ActivityAware and/or ServiceAware interfaces, where a Lifecycle reference can be obtained.

  • Constructor Details

  • Method Details

    • getApplicationContext

      @NonNull public Context getApplicationContext()
    • getFlutterEngine

      @Deprecated @NonNull public FlutterEngine getFlutterEngine()
      Deprecated.
      Use getBinaryMessenger(), getTextureRegistry(), or getPlatformViewRegistry() instead.
    • getBinaryMessenger

      @NonNull public BinaryMessenger getBinaryMessenger()
    • getTextureRegistry

      @NonNull public TextureRegistry getTextureRegistry()
    • getPlatformViewRegistry

      @NonNull public PlatformViewRegistry getPlatformViewRegistry()
    • getFlutterAssets

      @NonNull public FlutterPlugin.FlutterAssets getFlutterAssets()
    • getEngineGroup

      @Nullable public FlutterEngineGroup getEngineGroup()
      Accessor for the FlutterEngineGroup used to create the FlutterEngine for the app.

      This is useful in the rare case that a plugin has to spawn its own engine (for example, running an engine the background). The result is nullable since old versions of Flutter and custom setups may not have used a FlutterEngineGroup. Failing to use this when it is available will result in suboptimal performance and odd behaviors related to Dart isolate groups.