public class FlutterPluginRegistry extends Object implements PluginRegistry, PluginRegistry.RequestPermissionsResultListener, PluginRegistry.ActivityResultListener, PluginRegistry.NewIntentListener, PluginRegistry.UserLeaveHintListener, PluginRegistry.ViewDestroyListener
PluginRegistry.ActivityResultListener, PluginRegistry.NewIntentListener, PluginRegistry.PluginRegistrantCallback, PluginRegistry.Registrar, PluginRegistry.RequestPermissionsResultListener, PluginRegistry.UserLeaveHintListener, PluginRegistry.ViewDestroyListener
Constructor and Description |
---|
FlutterPluginRegistry(FlutterNativeView nativeView,
Context context) |
Modifier and Type | Method and Description |
---|---|
void |
attach(FlutterView flutterView,
Activity activity) |
void |
destroy() |
void |
detach() |
boolean |
hasPlugin(String key)
Returns whether the specified plugin is known to this registry.
|
boolean |
onActivityResult(int requestCode,
int resultCode,
Intent data) |
boolean |
onNewIntent(Intent intent) |
void |
onPreEngineRestart() |
boolean |
onRequestPermissionsResult(int requestCode,
String[] permissions,
int[] grantResults) |
void |
onUserLeaveHint() |
boolean |
onViewDestroy(FlutterNativeView view) |
PluginRegistry.Registrar |
registrarFor(String pluginKey)
Returns a
PluginRegistry.Registrar for receiving the registrations pertaining
to the specified plugin. |
<T> T |
valuePublishedByPlugin(String pluginKey)
Returns the value published by the specified plugin, if any.
|
public FlutterPluginRegistry(FlutterNativeView nativeView, Context context)
public boolean hasPlugin(String key)
PluginRegistry
hasPlugin
in interface PluginRegistry
key
- a unique String identifying the plugin; typically the
fully qualified name of the plugin's main class.public <T> T valuePublishedByPlugin(String pluginKey)
PluginRegistry
Plugins may publish a single value, such as an instance of the plugin's main class, for situations where external control or interaction is needed. Clients are expected to know the value's type.
valuePublishedByPlugin
in interface PluginRegistry
pluginKey
- a unique String identifying the plugin; typically the
fully qualified name of the plugin's main class.public PluginRegistry.Registrar registrarFor(String pluginKey)
PluginRegistry
PluginRegistry.Registrar
for receiving the registrations pertaining
to the specified plugin.registrarFor
in interface PluginRegistry
pluginKey
- a unique String identifying the plugin; typically the
fully qualified name of the plugin's main class.public void attach(FlutterView flutterView, Activity activity)
public void detach()
public void onPreEngineRestart()
public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
onRequestPermissionsResult
in interface PluginRegistry.RequestPermissionsResultListener
public boolean onActivityResult(int requestCode, int resultCode, Intent data)
onActivityResult
in interface PluginRegistry.ActivityResultListener
public boolean onNewIntent(Intent intent)
onNewIntent
in interface PluginRegistry.NewIntentListener
public void onUserLeaveHint()
onUserLeaveHint
in interface PluginRegistry.UserLeaveHintListener
public boolean onViewDestroy(FlutterNativeView view)
onViewDestroy
in interface PluginRegistry.ViewDestroyListener
public void destroy()