Class FlutterPlugin.FlutterPluginBinding
java.lang.Object
io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding
- Enclosing interface:
- FlutterPlugin
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 Summary
ConstructorDescriptionFlutterPluginBinding
(Context applicationContext, FlutterEngine flutterEngine, BinaryMessenger binaryMessenger, TextureRegistry textureRegistry, PlatformViewRegistry platformViewRegistry, FlutterPlugin.FlutterAssets flutterAssets, FlutterEngineGroup group) -
Method Summary
Modifier and TypeMethodDescriptionAccessor for theFlutterEngineGroup
used to create theFlutterEngine
for the app.Deprecated.
-
Constructor Details
-
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 Details
-
getApplicationContext
-
getFlutterEngine
Deprecated.UsegetBinaryMessenger()
,getTextureRegistry()
, orgetPlatformViewRegistry()
instead. -
getBinaryMessenger
-
getTextureRegistry
-
getPlatformViewRegistry
-
getFlutterAssets
-
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.
-
getBinaryMessenger()
,getTextureRegistry()
, orgetPlatformViewRegistry()
instead.