Protocols
The following protocols are available globally.
-
Wraps a
See moreUIView
for embedding in the Flutter hierarchyDeclaration
Objective-C
@protocol FlutterPlatformView <NSObject>
-
Undocumented
See moreDeclaration
Objective-C
@protocol FlutterPlatformViewFactory <NSObject> /** * Create a `FlutterPlatformView`. * * Implemented by iOS code that expose a `UIView` for embedding in a Flutter app. * * The implementation of this method should create a new `UIView` and return it. * * @param frame The rectangle for the newly created `UIView` measued in points. * @param viewId A unique identifier for this `UIView`. * @param args Parameters for creating the `UIView` sent from the Dart side of the Flutter app. * If `createArgsCodec` is not implemented, or if no creation arguments were sent from the Dart * code, this will be null. Otherwise this will be the value sent from the Dart code as decoded by * `createArgsCodec`. */ - (NSObject<FlutterPlatformView>*)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id _Nullable)args; /** * Returns the `FlutterMessageCodec` for decoding the args parameter of `createWithFrame`. * * Only needs to be implemented if `createWithFrame` needs an arguments parameter. */ @optional - (NSObject<FlutterMessageCodec>*)createArgsCodec; @end
-
Implemented by the iOS part of a Flutter plugin.
Defines a set of optional callback methods and a method to set up the plugin and register it to be called by other application components.
See moreDeclaration
Objective-C
@protocol FlutterPlugin <NSObject>
-
Registration context for a single
FlutterPlugin
, providing a one stop shop for the plugin to access contextual information and register callbacks for various application events.Registrars are obtained from a
See moreFlutterPluginRegistry
which keeps track of the identity of registered plugins and provides basic support for cross-plugin coordination.Declaration
Objective-C
@protocol FlutterPluginRegistrar <NSObject>
-
A registry of Flutter iOS plugins.
Plugins are identified by unique string keys, typically the name of the plugin’s main class. The registry tracks plugins by this key, mapping it to a value published by the plugin during registration, if any. This provides a very basic means of cross-plugin coordination with loose coupling between unrelated plugins.
Plugins typically need contextual information and the ability to register callbacks for various application events. To keep the API of the registry focused, these facilities are not provided directly by the registry, but by a
FlutterPluginRegistrar
, created by the registry in exchange for the unique key of the plugin.There is no implied connection between the registry and the registrar. Specifically, callbacks registered by the plugin via the registrar may be relayed directly to the underlying iOS application objects.
See moreDeclaration
Objective-C
@protocol FlutterPluginRegistry <NSObject>
-
Implement this in the
See moreUIAppDelegate
of your app to enable Flutter plugins to register themselves to the application life cycle events.Declaration
Objective-C
@protocol FlutterAppLifeCycleProvider
-
Undocumented
See moreDeclaration
Objective-C
@protocol FlutterTexture <NSObject> - (CVPixelBufferRef _Nullable)copyPixelBuffer; @end
-
Undocumented
See moreDeclaration
Objective-C
@protocol FlutterTextureRegistry <NSObject> - (int64_t)registerTexture:(NSObject<FlutterTexture>*)texture; - (void)textureFrameAvailable:(int64_t)textureId; - (void)unregisterTexture:(int64_t)textureId; @end