| Flutter macOS Embedder |

FlutterPluginMacOS.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_HEADERS_FLUTTERPLUGINMACOS_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_HEADERS_FLUTTERPLUGINMACOS_H_
7
8 #import <Foundation/Foundation.h>
9
10 #import "FlutterAppLifecycleDelegate.h"
11 #import "FlutterChannels.h"
12 #import "FlutterCodecs.h"
13 #import "FlutterMacros.h"
14
15 NS_ASSUME_NONNULL_BEGIN
16
17 @protocol FlutterPluginRegistrar;
18
19 /**
20 * Implemented by the platform side of a Flutter plugin.
21 *
22 * Defines a set of optional callback methods and a method to set up the plugin
23 * and register it to be called by other application components.
24 *
25 * Currently the macOS version of FlutterPlugin has very limited functionality, but is expected to
26 * expand over time to more closely match the functionality of the iOS FlutterPlugin.
27 */
28 FLUTTER_DARWIN_EXPORT
29 @protocol FlutterPlugin <NSObject, FlutterAppLifecycleDelegate>
30
31 /**
32 * Creates an instance of the plugin to register with |registrar| using the desired
33 * FlutterPluginRegistrar methods.
34 */
35 + (void)registerWithRegistrar:(id<FlutterPluginRegistrar>)registrar;
36
37 @optional
38
39 /**
40 * Called when a message is sent from Flutter on a channel that a plugin instance has subscribed
41 * to via -[FlutterPluginRegistrar addMethodCallDelegate:channel:].
42 *
43 * The |result| callback must be called exactly once, with one of:
44 * - FlutterMethodNotImplemented, if the method call is unknown.
45 * - A FlutterError, if the method call was understood but there was a
46 * problem handling it.
47 * - Any other value (including nil) to indicate success. The value will
48 * be returned to the Flutter caller, and must be serializable to JSON.
49 */
50 - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result;
51
52 NS_ASSUME_NONNULL_END
53
54 @end
55
56 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_HEADERS_FLUTTERPLUGINMACOS_H_
FlutterAppLifecycleDelegate.h
FlutterChannels.h
FlutterResult
void(^ FlutterResult)(id _Nullable result)
Definition: FlutterChannels.h:194
FlutterCodecs.h
FlutterMacros.h
NS_ASSUME_NONNULL_BEGIN
#define NS_ASSUME_NONNULL_BEGIN
Definition: FlutterMacros.h:19
NS_ASSUME_NONNULL_END
#define NS_ASSUME_NONNULL_END
Definition: FlutterMacros.h:20
FLUTTER_DARWIN_EXPORT
#define FLUTTER_DARWIN_EXPORT
Definition: FlutterMacros.h:14
FlutterMethodCall
Definition: FlutterCodecs.h:221
FlutterAppLifecycleDelegate-p
Definition: FlutterAppLifecycleDelegate.h:21
FlutterPlugin-p
Definition: FlutterPluginMacOS.h:29
FlutterPluginRegistrar-p
Definition: FlutterPluginRegistrarMacOS.h:28