Protocols
The following protocols are available globally.
-
A facility for communicating with the Flutter side using asynchronous message passing with binary messages.
Implementated by:
FlutterBasicMessageChannel
, which supports communication using structured messages.FlutterMethodChannel
, which supports communication using asynchronous method calls.FlutterEventChannel
, which supports commuication using event streams.
Declaration
Objective-C
@protocol FlutterBinaryMessenger <NSObject>
-
A strategy for exposing an event stream to the Flutter side.
See moreDeclaration
Objective-C
@protocol FlutterStreamHandler
-
A message encoding/decoding mechanism.
See moreDeclaration
Objective-C
@protocol FlutterMessageCodec
-
A codec for method calls and enveloped results.
Method calls are encoded as binary messages with enough structure that the codec can extract a method name
NSString
and an argumentsNSObject
, possiblynil
. These data items are used to populate aFlutterMethodCall
.Result envelopes are encoded as binary messages with enough structure that the codec can determine whether the result was successful or an error. In the former case, the codec can extract the result
See moreNSObject
, possiblynil
. In the latter case, the codec can extract an error codeNSString
, a human-readableNSString
error message (possiblynil
), and a custom error detailsNSObject
, possiblynil
. These data items are used to populate aFlutterError
.Declaration
Objective-C
@protocol FlutterMethodCodec
-
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` measured 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
-
Protocol for listener of events from the UIApplication, typically a FlutterPlugin.
See moreDeclaration
Objective-C
@protocol FlutterApplicationLifeCycleDelegate <UNUserNotificationCenterDelegate>
-
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, FlutterApplicationLifeCycleDelegate>
-
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
UIAppDelegate
of your app to enable Flutter plugins to register themselves to the application life cycle events.For plugins to receive events from
See moreUNUserNotificationCenter
, register this as theUNUserNotificationCenterDelegate
.Declaration
Objective-C
@protocol FlutterAppLifeCycleProvider <UNUserNotificationCenterDelegate>
-
Represents a texture that can be shared with Flutter.
See also: https://github.com/flutter/plugins/tree/master/packages/camera
See moreDeclaration
Objective-C
@protocol FlutterTexture <NSObject>
-
A collection of registered
See moreFlutterTexture
‘s.Declaration
Objective-C
@protocol FlutterTextureRegistry <NSObject>