public interface PluginRegistry
Flutter applications by default include an auto-generated and auto-updated plugin registrant
class (GeneratedPluginRegistrant) that makes use of a PluginRegistry
to register
contributions from each plugin mentioned in the application's pubspec file. The generated
registrant class is, again by default, called from the application's main Activity
, which
defaults to an instance of FlutterActivity
, itself a PluginRegistry
.
This class is now deprecated. See https://flutter.dev/go/android-project-migration for migration details.
Modifier and Type | Interface and Description |
---|---|
static interface |
PluginRegistry.ActivityResultListener
Delegate interface for handling activity results on behalf of the main
Activity . |
static interface |
PluginRegistry.NewIntentListener
Delegate interface for handling new intents on behalf of the main
Activity . |
static interface |
PluginRegistry.PluginRegistrantCallback
Callback interface for registering plugins with a plugin registry.
|
static interface |
PluginRegistry.Registrar
Receiver of registrations from a single plugin.
|
static interface |
PluginRegistry.RequestPermissionsResultListener
Delegate interface for handling result of permissions requests on behalf of the main
Activity . |
static interface |
PluginRegistry.UserLeaveHintListener
Delegate interface for handling user leave hints on behalf of the main
Activity . |
static interface |
PluginRegistry.ViewDestroyListener
Delegate interface for handling an
Activity 's onDestroy method being called. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasPlugin(String pluginKey)
Returns whether the specified plugin is known to this registry.
|
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.
|
PluginRegistry.Registrar registrarFor(String pluginKey)
PluginRegistry.Registrar
for receiving the registrations pertaining to the specified plugin.pluginKey
- a unique String identifying the plugin; typically the fully qualified name of
the plugin's main class.boolean hasPlugin(String pluginKey)
pluginKey
- a unique String identifying the plugin; typically the fully qualified name of
the plugin's main class.<T> T valuePublishedByPlugin(String pluginKey)
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.
pluginKey
- a unique String identifying the plugin; typically the fully qualified name of
the plugin's main class.