Flutter Engine
The Flutter Engine
|
#import <FlutterPlugin.h>
Instance Methods | |
(NSObject< FlutterBinaryMessenger > *) | - messenger |
(NSObject< FlutterTextureRegistry > *) | - textures |
(void) | - registerViewFactory:withId: |
(void) | - registerViewFactory:withId:gestureRecognizersBlockingPolicy: |
(void) | - publish: |
(void) | - addMethodCallDelegate:channel: |
(void) | - addApplicationDelegate: |
(NSString *) | - lookupKeyForAsset: |
(NSString *) | - lookupKeyForAsset:fromPackage: |
(void) | - addMethodCallDelegate:channel: |
(void) | - addApplicationDelegate: |
(void) | - registerViewFactory:withId: |
(void) | - publish: |
(nonnull NSString *) | - lookupKeyForAsset: |
(nonnull NSString *) | - lookupKeyForAsset:fromPackage: |
Properties | |
id< FlutterBinaryMessenger > | messenger |
id< FlutterTextureRegistry > | textures |
NSView * | view |
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 FlutterPluginRegistry
which keeps track of the identity of registered plugins and provides basic support for cross-plugin coordination.
The protocol for an object managing registration for a plugin. It provides access to application context, as allowing registering for callbacks for handling various conditions.
Currently the macOS PluginRegistrar has very limited functionality, but is expected to expand over time to more closely match the functionality of FlutterPluginRegistrar.
Definition at line 283 of file FlutterPlugin.h.
- (void) addApplicationDelegate: | ("Disallowed in plugins used in app extensions") | NS_EXTENSION_UNAVAILABLE_IOS |
Registers the plugin as a receiver of UIApplicationDelegate
calls.
delegate | The receiving object, such as the plugin's main class. |
Reimplemented in FlutterEngineRegistrar.
- (void) addApplicationDelegate: | (nonnull NSObject< FlutterAppLifecycleDelegate > *) | delegate |
Registers the plugin as a receiver of NSApplicationDelegate
calls.
delegate | The receiving object, such as the plugin's main class. |
Reimplemented in FakePluginRegistrar.
- (void) addMethodCallDelegate: | (nonnull id< FlutterPlugin >) | delegate | |
channel: | (nonnull FlutterMethodChannel *) | channel | |
Registers |delegate| to receive handleMethodCall:result: callbacks for the given |channel|.
Reimplemented in FlutterEngineRegistrar, and FakePluginRegistrar.
- (void) addMethodCallDelegate: | (NSObject< FlutterPlugin > *) | delegate | |
channel: | (FlutterMethodChannel *) | channel | |
Registers the plugin as a receiver of incoming method calls from the Dart side on the specified FlutterMethodChannel
.
delegate | The receiving object, such as the plugin's main class. |
channel | The channel |
Reimplemented in FlutterEngineRegistrar.
- (nonnull NSString *) lookupKeyForAsset: | (nonnull NSString *) | asset |
Returns the file name for the given asset. The returned file name can be used to access the asset in the application's main bundle.
asset | The name of the asset. The name can be hierarchical. |
Reimplemented in FakePluginRegistrar.
- (NSString *) lookupKeyForAsset: | (NSString *) | asset |
Returns the file name for the given asset. The returned file name can be used to access the asset in the application's main bundle.
asset | The name of the asset. The name can be hierarchical. |
Reimplemented in FlutterEngineRegistrar.
- (nonnull NSString *) lookupKeyForAsset: | (nonnull NSString *) | asset | |
fromPackage: | (nonnull NSString *) | package | |
Returns the file name for the given asset which originates from the specified package. The returned file name can be used to access the asset in the application's main bundle.
asset | The name of the asset. The name can be hierarchical. |
package | The name of the package from which the asset originates. |
Reimplemented in FakePluginRegistrar.
- (NSString *) lookupKeyForAsset: | (NSString *) | asset | |
fromPackage: | (NSString *) | package | |
Returns the file name for the given asset which originates from the specified package. The returned file name can be used to access the asset in the application's main bundle.
asset | The name of the asset. The name can be hierarchical. |
package | The name of the package from which the asset originates. |
Reimplemented in FlutterEngineRegistrar.
- (NSObject< FlutterBinaryMessenger > *) messenger |
Returns a FlutterBinaryMessenger
for creating Dart/iOS communication channels to be used by the plugin.
Reimplemented in FlutterEngineRegistrar.
- (void) publish: | (nonnull NSObject *) | value |
Publishes a value for external use of the plugin.
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.
The published value will be available from the FlutterPluginRegistry
. Repeated calls overwrite any previous publication.
value | The value to be published. |
Reimplemented in FakePluginRegistrar.
- (void) publish: | (NSObject *) | value |
Publishes a value for external use of the plugin.
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.
The published value will be available from the FlutterPluginRegistry
. Repeated calls overwrite any previous publication.
value | The value to be published. |
Reimplemented in FlutterEngineRegistrar.
- (void) registerViewFactory: | (nonnull NSObject< FlutterPlatformViewFactory > *) | factory | |
withId: | (nonnull NSString *) | factoryId | |
Registers a FlutterPlatformViewFactory
for creation of platform views.
Plugins expose NSView
for embedding in Flutter apps by registering a view factory.
factory | The view factory that will be registered. |
factoryId | A unique identifier for the factory, the Dart code of the Flutter app can use this identifier to request creation of a NSView by the registered factory. |
Reimplemented in FlutterEngineRegistrar, and FakePluginRegistrar.
- (void) registerViewFactory: | (NSObject< FlutterPlatformViewFactory > *) | factory | |
withId: | (NSString *) | factoryId | |
Registers a FlutterPlatformViewFactory
for creation of platform views.
Plugins expose UIView
for embedding in Flutter apps by registering a view factory.
factory | The view factory that will be registered. |
factoryId | A unique identifier for the factory, the Dart code of the Flutter app can use this identifier to request creation of a UIView by the registered factory. |
Reimplemented in FlutterEngineRegistrar.
- (void) registerViewFactory: | (NSObject< FlutterPlatformViewFactory > *) | factory | |
withId: | (NSString *) | factoryId | |
gestureRecognizersBlockingPolicy: | (FlutterPlatformViewGestureRecognizersBlockingPolicy) | gestureRecognizersBlockingPolicy | |
Registers a FlutterPlatformViewFactory
for creation of platform views.
Plugins can expose a UIView
for embedding in Flutter apps by registering a view factory.
factory | The view factory that will be registered. |
factoryId | A unique identifier for the factory, the Dart code of the Flutter app can use this identifier to request creation of a UIView by the registered factory. |
gestureRecognizersBlockingPolicy | How UIGestureRecognizers on the platform views are blocked. |
Reimplemented in FlutterEngineRegistrar.
- (NSObject< FlutterTextureRegistry > *) textures |
Returns a FlutterTextureRegistry
for registering textures provided by the plugin.
Reimplemented in FlutterEngineRegistrar.
|
readatomicassign |
The binary messenger used for creating channels to communicate with the Flutter engine.
Reimplemented in FlutterEngineRegistrar.
Definition at line 33 of file FlutterPluginRegistrarMacOS.h.
|
readatomicassign |
Returns a FlutterTextureRegistry
for registering textures provided by the plugin.
Reimplemented in FlutterEngineRegistrar.
Definition at line 39 of file FlutterPluginRegistrarMacOS.h.
|
readatomicassign |
The view displaying Flutter content.
This property is provided for backwards compatibility for apps that assume a single view. This will eventually be replaced by a multi-view API variant.
This method may return |nil|, for instance in a headless environment.
Reimplemented in FlutterEngineRegistrar.
Definition at line 50 of file FlutterPluginRegistrarMacOS.h.