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 givenFlutterEngine
.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 additionalActivityAware
and/orServiceAware
interfaces, where aLifecycle
reference can be obtained.
-
-
Constructor Summary
Constructors Constructor Description FlutterPluginBinding(Context applicationContext, FlutterEngine flutterEngine, BinaryMessenger binaryMessenger, TextureRegistry textureRegistry, PlatformViewRegistry platformViewRegistry, FlutterPlugin.FlutterAssets flutterAssets, FlutterEngineGroup group)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Context
getApplicationContext()
BinaryMessenger
getBinaryMessenger()
FlutterEngineGroup
getEngineGroup()
Accessor for theFlutterEngineGroup
used to create theFlutterEngine
for the app.FlutterPlugin.FlutterAssets
getFlutterAssets()
FlutterEngine
getFlutterEngine()
Deprecated.UsegetBinaryMessenger()
,getTextureRegistry()
, orgetPlatformViewRegistry()
instead.PlatformViewRegistry
getPlatformViewRegistry()
TextureRegistry
getTextureRegistry()
-
-
-
Constructor Detail
-
FlutterPluginBinding
public FlutterPluginBinding(@NonNull Context applicationContext, @NonNull FlutterEngine flutterEngine, @NonNull BinaryMessenger binaryMessenger, @NonNull TextureRegistry textureRegistry, @NonNull PlatformViewRegistry platformViewRegistry, @NonNull FlutterPlugin.FlutterAssets flutterAssets, @Nullable FlutterEngineGroup group)
-
-
Method Detail
-
getApplicationContext
@NonNull public Context getApplicationContext()
-
getFlutterEngine
@Deprecated @NonNull public FlutterEngine getFlutterEngine()
Deprecated.UsegetBinaryMessenger()
,getTextureRegistry()
, orgetPlatformViewRegistry()
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 theFlutterEngineGroup
used to create theFlutterEngine
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.
-
-