Interface PluginRegistry.Registrar
-
- Enclosing interface:
- PluginRegistry
@Deprecated public static interface PluginRegistry.Registrar
Deprecated.This registrar is for Flutter's v1 embedding. For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migrationReceiver of registrations from a single plugin.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ContextactiveContext()Deprecated.Returns the activeContext.Activityactivity()Deprecated.Returns theActivitythat forms the plugin's operating context.PluginRegistry.RegistraraddActivityResultListener(PluginRegistry.ActivityResultListener listener)Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onActivityResult(int, int, Intent).PluginRegistry.RegistraraddNewIntentListener(PluginRegistry.NewIntentListener listener)Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onNewIntent(Intent).PluginRegistry.RegistraraddRequestPermissionsResultListener(PluginRegistry.RequestPermissionsResultListener listener)Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity#onRequestPermissionsResult(int, String[], int[])orandroidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, String[], int[]).PluginRegistry.RegistraraddUserLeaveHintListener(PluginRegistry.UserLeaveHintListener listener)Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onUserLeaveHint().PluginRegistry.RegistraraddViewDestroyListener(PluginRegistry.ViewDestroyListener listener)Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onDestroy().Contextcontext()Deprecated.Returns theApplication'sContext.StringlookupKeyForAsset(String asset)Deprecated.Returns the file name for the given asset.StringlookupKeyForAsset(String asset, String packageName)Deprecated.Returns the file name for the given asset which originates from the specified packageName.BinaryMessengermessenger()Deprecated.Returns aBinaryMessengerwhich the plugin can use for creating channels for communicating with the Dart side.PlatformViewRegistryplatformViewRegistry()Deprecated.Returns the application'sPlatformViewRegistry.PluginRegistry.Registrarpublish(Object value)Deprecated.Publishes a value associated with the plugin being registered.TextureRegistrytextures()Deprecated.Returns aTextureRegistrywhich the plugin can use for managing backend textures.FlutterViewview()Deprecated.Returns theFlutterViewthat's instantiated by this plugin'sactivity.
-
-
-
Method Detail
-
activity
@Nullable Activity activity()
Deprecated.Returns theActivitythat forms the plugin's operating context.Plugin authors should not assume the type returned by this method is any specific subclass of
Activity(such asFlutterActivityorFlutterFragmentActivity), as applications are free to use any activity subclass.When there is no foreground activity in the application, this will return null. If a
Contextis needed, use context() to get the application's context.This registrar is for Flutter's v1 embedding. To access an
Activityfrom a plugin using the v2 embedding, seeActivityPluginBinding.getActivity(). To obtain an instance of anActivityPluginBindingin a Flutter plugin, implement theActivityAwareinterface. A binding is provided inActivityAware.onAttachedToActivity(ActivityPluginBinding)andActivityAware.onReattachedToActivityForConfigChanges(ActivityPluginBinding).For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
-
context
@NonNull Context context()
Deprecated.Returns theApplication'sContext.This registrar is for Flutter's v1 embedding. To access a
Contextfrom a plugin using the v2 embedding, seeFlutterPlugin.FlutterPluginBinding.getApplicationContext()For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
-
activeContext
@NonNull Context activeContext()
Deprecated.Returns the activeContext.This registrar is for Flutter's v1 embedding. In the v2 embedding, there is no concept of an "active context". Either use the application
Contextor an attachedActivity. Seecontext()andactivity()for more details.For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Returns:
- the current
Activity, if not null, otherwise theApplication.
-
messenger
@NonNull BinaryMessenger messenger()
Deprecated.Returns aBinaryMessengerwhich the plugin can use for creating channels for communicating with the Dart side.This registrar is for Flutter's v1 embedding. To access a
BinaryMessengerfrom a plugin using the v2 embedding, seeFlutterPlugin.FlutterPluginBinding.getBinaryMessenger()For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
-
textures
@NonNull TextureRegistry textures()
Deprecated.Returns aTextureRegistrywhich the plugin can use for managing backend textures.This registrar is for Flutter's v1 embedding. To access a
TextureRegistryfrom a plugin using the v2 embedding, seeFlutterPlugin.FlutterPluginBinding.getTextureRegistry()For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
-
platformViewRegistry
@NonNull PlatformViewRegistry platformViewRegistry()
Deprecated.Returns the application'sPlatformViewRegistry.Plugins can use the platform registry to register their view factories.
This registrar is for Flutter's v1 embedding. To access a
PlatformViewRegistryfrom a plugin using the v2 embedding, seeFlutterPlugin.FlutterPluginBinding.getPlatformViewRegistry()For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
-
view
@NonNull FlutterView view()
Deprecated.Returns theFlutterViewthat's instantiated by this plugin'sactivity.This registrar is for Flutter's v1 embedding. The
FlutterViewreferenced by this method does not exist in the v2 embedding. Additionally, noViewis exposed to any plugins in the v2 embedding. Platform views can access their containingViewusing the platform views APIs. If you have a use-case that absolutely requires a plugin to access an AndroidView, please file a ticket on GitHub.For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
-
lookupKeyForAsset
@NonNull String lookupKeyForAsset(@NonNull String asset)
Deprecated.Returns the file name for the given asset. The returned file name can be used to access the asset in the APK through theAssetManagerAPI.TODO(mattcarroll): point this method towards new lookup method.
- Parameters:
asset- the name of the asset. The name can be hierarchical- Returns:
- the filename to be used with
AssetManager
-
lookupKeyForAsset
@NonNull String lookupKeyForAsset(@NonNull String asset, @NonNull String packageName)
Deprecated.Returns the file name for the given asset which originates from the specified packageName. The returned file name can be used to access the asset in the APK through theAssetManagerAPI.TODO(mattcarroll): point this method towards new lookup method.
- Parameters:
asset- the name of the asset. The name can be hierarchicalpackageName- the name of the package from which the asset originates- Returns:
- the file name to be used with
AssetManager
-
publish
@NonNull PluginRegistry.Registrar publish(@Nullable Object value)
Deprecated.Publishes a value associated with the plugin being registered.The published value is available to interested clients via
PluginRegistry.valuePublishedByPlugin(String).Publication should be done only when client code needs to interact with the plugin in a way that cannot be accomplished by the plugin registering callbacks with client APIs.
Overwrites any previously published value.
This registrar is for Flutter's v1 embedding. The concept of publishing values from plugins is not supported in the v2 embedding.
For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Parameters:
value- the value, possibly null.- Returns:
- this
PluginRegistry.Registrar.
-
addRequestPermissionsResultListener
@NonNull PluginRegistry.Registrar addRequestPermissionsResultListener(@NonNull PluginRegistry.RequestPermissionsResultListener listener)
Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity#onRequestPermissionsResult(int, String[], int[])orandroidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, String[], int[]).This registrar is for Flutter's v1 embedding. To listen for permission results in the v2 embedding, use
ActivityPluginBinding.addRequestPermissionsResultListener(PluginRegistry.RequestPermissionsResultListener).For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Parameters:
listener- aPluginRegistry.RequestPermissionsResultListenercallback.- Returns:
- this
PluginRegistry.Registrar.
-
addActivityResultListener
@NonNull PluginRegistry.Registrar addActivityResultListener(@NonNull PluginRegistry.ActivityResultListener listener)
Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onActivityResult(int, int, Intent).This registrar is for Flutter's v1 embedding. To listen for
Activityresults in the v2 embedding, useActivityPluginBinding.addActivityResultListener(PluginRegistry.ActivityResultListener).For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Parameters:
listener- anPluginRegistry.ActivityResultListenercallback.- Returns:
- this
PluginRegistry.Registrar.
-
addNewIntentListener
@NonNull PluginRegistry.Registrar addNewIntentListener(@NonNull PluginRegistry.NewIntentListener listener)
Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onNewIntent(Intent).This registrar is for Flutter's v1 embedding. To listen for new
Intents in the v2 embedding, useActivityPluginBinding.addOnNewIntentListener(PluginRegistry.NewIntentListener).For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Parameters:
listener- aPluginRegistry.NewIntentListenercallback.- Returns:
- this
PluginRegistry.Registrar.
-
addUserLeaveHintListener
@NonNull PluginRegistry.Registrar addUserLeaveHintListener(@NonNull PluginRegistry.UserLeaveHintListener listener)
Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onUserLeaveHint().This registrar is for Flutter's v1 embedding. To listen for leave hints in the v2 embedding, use
ActivityPluginBinding.addOnUserLeaveHintListener(PluginRegistry.UserLeaveHintListener).For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Parameters:
listener- aPluginRegistry.UserLeaveHintListenercallback.- Returns:
- this
PluginRegistry.Registrar.
-
addViewDestroyListener
@NonNull PluginRegistry.Registrar addViewDestroyListener(@NonNull PluginRegistry.ViewDestroyListener listener)
Deprecated.Adds a callback allowing the plugin to take part in handling incoming calls toActivity.onDestroy().This registrar is for Flutter's v1 embedding. The concept of
Viewdestruction does not exist in the v2 embedding. However, plugins in the v2 embedding can respond toActivityAware.onDetachedFromActivityForConfigChanges()andActivityAware.onDetachedFromActivity(), which indicate the loss of a visual context for the running Flutter experience. Developers should implementActivityAwarefor theirFlutterPluginif such callbacks are needed. Also, plugins can respond toFlutterPlugin.onDetachedFromEngine(FlutterPlugin.FlutterPluginBinding), which indicates that the given plugin has been completely disconnected from the associated Flutter experience and should clean up any resources.For instructions on migrating a plugin from Flutter's v1 Android embedding to v2, visit http://flutter.dev/go/android-plugin-migration
- Parameters:
listener- aPluginRegistry.ViewDestroyListenercallback.- Returns:
- this
PluginRegistry.Registrar.
-
-