hg ignore up
This commit is contained in:
Binary file not shown.
@@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>App</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>io.flutter.flutter.app</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>App</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>UIRequiredDeviceCapabilities</key>
|
|
||||||
<array>
|
|
||||||
<string>arm64</string>
|
|
||||||
</array>
|
|
||||||
<key>MinimumOSVersion</key>
|
|
||||||
<string>8.0</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
Binary file not shown.
@@ -1,66 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTER_H_
|
|
||||||
#define FLUTTER_FLUTTER_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
BREAKING CHANGES:
|
|
||||||
|
|
||||||
October 5, 2018:
|
|
||||||
- Removed FlutterNavigationController.h/.mm
|
|
||||||
- Changed return signature of `FlutterDartHeadlessCodeRunner.run*` from void
|
|
||||||
to bool
|
|
||||||
- Removed HeadlessPlatformViewIOS
|
|
||||||
- Marked FlutterDartHeadlessCodeRunner deprecated
|
|
||||||
|
|
||||||
August 31, 2018: Marked -[FlutterDartProject
|
|
||||||
initFromDefaultSourceForConfiguration] and FlutterStandardBigInteger as
|
|
||||||
unavailable.
|
|
||||||
|
|
||||||
July 26, 2018: Marked -[FlutterDartProject
|
|
||||||
initFromDefaultSourceForConfiguration] deprecated.
|
|
||||||
|
|
||||||
February 28, 2018: Removed "initWithFLXArchive" and
|
|
||||||
"initWithFLXArchiveWithScriptSnapshot".
|
|
||||||
|
|
||||||
January 15, 2018: Marked "initWithFLXArchive" and
|
|
||||||
"initWithFLXArchiveWithScriptSnapshot" as unavailable following the
|
|
||||||
deprecation from December 11, 2017. Scheduled to be removed on February
|
|
||||||
19, 2018.
|
|
||||||
|
|
||||||
January 09, 2018: Deprecated "FlutterStandardBigInteger" and its use in
|
|
||||||
"FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to
|
|
||||||
be marked as unavailable once the deprecation has been available on the
|
|
||||||
flutter/flutter alpha branch for four weeks. "FlutterStandardBigInteger" was
|
|
||||||
needed because the Dart 1.0 int type had no size limit. With Dart 2.0, the
|
|
||||||
int type is a fixed-size, 64-bit signed integer. If you need to communicate
|
|
||||||
larger integers, use NSString encoding instead.
|
|
||||||
|
|
||||||
December 11, 2017: Deprecated "initWithFLXArchive" and
|
|
||||||
"initWithFLXArchiveWithScriptSnapshot" and scheculed the same to be marked as
|
|
||||||
unavailable on January 15, 2018. Instead, "initWithFlutterAssets" and
|
|
||||||
"initWithFlutterAssetsWithScriptSnapshot" should be used. The reason for this
|
|
||||||
change is that the FLX archive will be deprecated and replaced with a flutter
|
|
||||||
assets directory containing the same files as the FLX did.
|
|
||||||
|
|
||||||
November 29, 2017: Added a BREAKING CHANGES section.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "FlutterAppDelegate.h"
|
|
||||||
#include "FlutterBinaryMessenger.h"
|
|
||||||
#include "FlutterCallbackCache.h"
|
|
||||||
#include "FlutterChannels.h"
|
|
||||||
#include "FlutterCodecs.h"
|
|
||||||
#include "FlutterDartProject.h"
|
|
||||||
#include "FlutterEngine.h"
|
|
||||||
#include "FlutterHeadlessDartRunner.h"
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
#include "FlutterPlatformViews.h"
|
|
||||||
#include "FlutterPlugin.h"
|
|
||||||
#include "FlutterPluginAppLifeCycleDelegate.h"
|
|
||||||
#include "FlutterTexture.h"
|
|
||||||
#include "FlutterViewController.h"
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTER_H_
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERAPPDELEGATE_H_
|
|
||||||
#define FLUTTER_FLUTTERAPPDELEGATE_H_
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
#include "FlutterPlugin.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* `UIApplicationDelegate` subclass for simple apps that want default behavior.
|
|
||||||
*
|
|
||||||
* This class implements the following behaviors:
|
|
||||||
* * Status bar touches are forwarded to the key window's root view
|
|
||||||
* `FlutterViewController`, in order to trigger scroll to top.
|
|
||||||
* * Keeps the Flutter connection open in debug mode when the phone screen
|
|
||||||
* locks.
|
|
||||||
*
|
|
||||||
* App delegates for Flutter applications are *not* required to inherit from
|
|
||||||
* this class. Developers of custom app delegate classes should copy and paste
|
|
||||||
* code as necessary from FlutterAppDelegate.mm.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterAppDelegate
|
|
||||||
: UIResponder <UIApplicationDelegate, FlutterPluginRegistry, FlutterAppLifeCycleProvider>
|
|
||||||
|
|
||||||
@property(strong, nonatomic) UIWindow* window;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERDARTPROJECT_H_
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERBINARYMESSENGER_H_
|
|
||||||
#define FLUTTER_FLUTTERBINARYMESSENGER_H_
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
/**
|
|
||||||
* A message reply callback.
|
|
||||||
*
|
|
||||||
* Used for submitting a binary reply back to a Flutter message sender. Also used
|
|
||||||
* in for handling a binary message reply received from Flutter.
|
|
||||||
*
|
|
||||||
* @param reply The reply.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterBinaryReply)(NSData* _Nullable reply);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A strategy for handling incoming binary messages from Flutter and to send
|
|
||||||
* asynchronous replies back to Flutter.
|
|
||||||
*
|
|
||||||
* @param message The message.
|
|
||||||
* @param reply A callback for submitting an asynchronous reply to the sender.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterBinaryMessageHandler)(NSData* _Nullable message, FlutterBinaryReply reply);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@protocol FlutterBinaryMessenger <NSObject>
|
|
||||||
/**
|
|
||||||
* Sends a binary message to the Flutter side on the specified channel, expecting
|
|
||||||
* no reply.
|
|
||||||
*
|
|
||||||
* @param channel The channel name.
|
|
||||||
* @param message The message.
|
|
||||||
*/
|
|
||||||
- (void)sendOnChannel:(NSString*)channel message:(NSData* _Nullable)message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends a binary message to the Flutter side on the specified channel, expecting
|
|
||||||
* an asynchronous reply.
|
|
||||||
*
|
|
||||||
* @param channel The channel name.
|
|
||||||
* @param message The message.
|
|
||||||
* @param callback A callback for receiving a reply.
|
|
||||||
*/
|
|
||||||
- (void)sendOnChannel:(NSString*)channel
|
|
||||||
message:(NSData* _Nullable)message
|
|
||||||
binaryReply:(FlutterBinaryReply _Nullable)callback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a message handler for incoming binary messages from the Flutter side
|
|
||||||
* on the specified channel.
|
|
||||||
*
|
|
||||||
* Replaces any existing handler. Use a `nil` handler for unregistering the
|
|
||||||
* existing handler.
|
|
||||||
*
|
|
||||||
* @param channel The channel name.
|
|
||||||
* @param handler The message handler.
|
|
||||||
*/
|
|
||||||
- (void)setMessageHandlerOnChannel:(NSString*)channel
|
|
||||||
binaryMessageHandler:(FlutterBinaryMessageHandler _Nullable)handler;
|
|
||||||
@end
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
#endif // FLUTTER_FLUTTERBINARYMESSENGER_H_
|
|
||||||
@@ -1,371 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERCHANNELS_H_
|
|
||||||
#define FLUTTER_FLUTTERCHANNELS_H_
|
|
||||||
|
|
||||||
#include "FlutterBinaryMessenger.h"
|
|
||||||
#include "FlutterCodecs.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
/**
|
|
||||||
* A message reply callback.
|
|
||||||
*
|
|
||||||
* Used for submitting a reply back to a Flutter message sender. Also used in
|
|
||||||
* the dual capacity for handling a message reply received from Flutter.
|
|
||||||
*
|
|
||||||
* @param reply The reply.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterReply)(id _Nullable reply);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A strategy for handling incoming messages from Flutter and to send
|
|
||||||
* asynchronous replies back to Flutter.
|
|
||||||
*
|
|
||||||
* @param message The message.
|
|
||||||
* @param callback A callback for submitting a reply to the sender.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterMessageHandler)(id _Nullable message, FlutterReply callback);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A channel for communicating with the Flutter side using basic, asynchronous
|
|
||||||
* message passing.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterBasicMessageChannel : NSObject
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterBasicMessageChannel` with the specified name and binary
|
|
||||||
* messenger.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* The channel uses `FlutterStandardMessageCodec` to encode and decode messages.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
*/
|
|
||||||
+ (instancetype)messageChannelWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterBasicMessageChannel` with the specified name, binary
|
|
||||||
* messenger, and message codec.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
* @param codec The message codec.
|
|
||||||
*/
|
|
||||||
+ (instancetype)messageChannelWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
|
|
||||||
codec:(NSObject<FlutterMessageCodec>*)codec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes a `FlutterBasicMessageChannel` with the specified name, binary
|
|
||||||
* messenger, and message codec.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
* @param codec The message codec.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
|
|
||||||
codec:(NSObject<FlutterMessageCodec>*)codec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends the specified message to the Flutter side, ignoring any reply.
|
|
||||||
*
|
|
||||||
* @param message The message. Must be supported by the codec of this
|
|
||||||
* channel.
|
|
||||||
*/
|
|
||||||
- (void)sendMessage:(id _Nullable)message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends the specified message to the Flutter side, expecting an asynchronous
|
|
||||||
* reply.
|
|
||||||
*
|
|
||||||
* @param message The message. Must be supported by the codec of this channel.
|
|
||||||
* @param callback A callback to be invoked with the message reply from Flutter.
|
|
||||||
*/
|
|
||||||
- (void)sendMessage:(id _Nullable)message reply:(FlutterReply _Nullable)callback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a message handler with this channel.
|
|
||||||
*
|
|
||||||
* Replaces any existing handler. Use a `nil` handler for unregistering the
|
|
||||||
* existing handler.
|
|
||||||
*
|
|
||||||
* @param handler The message handler.
|
|
||||||
*/
|
|
||||||
- (void)setMessageHandler:(FlutterMessageHandler _Nullable)handler;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A method call result callback.
|
|
||||||
*
|
|
||||||
* Used for submitting a method call result back to a Flutter caller. Also used in
|
|
||||||
* the dual capacity for handling a method call result received from Flutter.
|
|
||||||
*
|
|
||||||
* @param result The result.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterResult)(id _Nullable result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A strategy for handling method calls.
|
|
||||||
*
|
|
||||||
* @param call The incoming method call.
|
|
||||||
* @param result A callback to asynchronously submit the result of the call.
|
|
||||||
* Invoke the callback with a `FlutterError` to indicate that the call failed.
|
|
||||||
* Invoke the callback with `FlutterMethodNotImplemented` to indicate that the
|
|
||||||
* method was unknown. Any other values, including `nil`, are interpreted as
|
|
||||||
* successful results.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterMethodCallHandler)(FlutterMethodCall* call, FlutterResult result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A constant used with `FlutterMethodCallHandler` to respond to the call of an
|
|
||||||
* unknown method.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
extern NSObject const* FlutterMethodNotImplemented;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A channel for communicating with the Flutter side using invocation of
|
|
||||||
* asynchronous methods.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterMethodChannel : NSObject
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterMethodChannel` with the specified name and binary messenger.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* The channel uses `FlutterStandardMethodCodec` to encode and decode method calls
|
|
||||||
* and result envelopes.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
*/
|
|
||||||
+ (instancetype)methodChannelWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterMethodChannel` with the specified name, binary messenger, and
|
|
||||||
* method codec.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
* @param codec The method codec.
|
|
||||||
*/
|
|
||||||
+ (instancetype)methodChannelWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
|
|
||||||
codec:(NSObject<FlutterMethodCodec>*)codec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes a `FlutterMethodChannel` with the specified name, binary messenger,
|
|
||||||
* and method codec.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
* @param codec The method codec.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
|
|
||||||
codec:(NSObject<FlutterMethodCodec>*)codec;
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
/**
|
|
||||||
* Invokes the specified Flutter method with the specified arguments, expecting
|
|
||||||
* no results.
|
|
||||||
*
|
|
||||||
* @see [MethodChannel.setMethodCallHandler](https://docs.flutter.io/flutter/services/MethodChannel/setMethodCallHandler.html)
|
|
||||||
*
|
|
||||||
* @param method The name of the method to invoke.
|
|
||||||
* @param arguments The arguments. Must be a value supported by the codec of this
|
|
||||||
* channel.
|
|
||||||
*/
|
|
||||||
// clang-format on
|
|
||||||
- (void)invokeMethod:(NSString*)method arguments:(id _Nullable)arguments;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invokes the specified Flutter method with the specified arguments, expecting
|
|
||||||
* an asynchronous result.
|
|
||||||
*
|
|
||||||
* @param method The name of the method to invoke.
|
|
||||||
* @param arguments The arguments. Must be a value supported by the codec of this
|
|
||||||
* channel.
|
|
||||||
* @param callback A callback that will be invoked with the asynchronous result.
|
|
||||||
* The result will be a `FlutterError` instance, if the method call resulted
|
|
||||||
* in an error on the Flutter side. Will be `FlutterMethodNotImplemented`, if
|
|
||||||
* the method called was not implemented on the Flutter side. Any other value,
|
|
||||||
* including `nil`, should be interpreted as successful results.
|
|
||||||
*/
|
|
||||||
- (void)invokeMethod:(NSString*)method
|
|
||||||
arguments:(id _Nullable)arguments
|
|
||||||
result:(FlutterResult _Nullable)callback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a handler for method calls from the Flutter side.
|
|
||||||
*
|
|
||||||
* Replaces any existing handler. Use a `nil` handler for unregistering the
|
|
||||||
* existing handler.
|
|
||||||
*
|
|
||||||
* @param handler The method call handler.
|
|
||||||
*/
|
|
||||||
- (void)setMethodCallHandler:(FlutterMethodCallHandler _Nullable)handler;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An event sink callback.
|
|
||||||
*
|
|
||||||
* @param event The event.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterEventSink)(id _Nullable event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A strategy for exposing an event stream to the Flutter side.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@protocol FlutterStreamHandler
|
|
||||||
/**
|
|
||||||
* Sets up an event stream and begin emitting events.
|
|
||||||
*
|
|
||||||
* Invoked when the first listener is registered with the Stream associated to
|
|
||||||
* this channel on the Flutter side.
|
|
||||||
*
|
|
||||||
* @param arguments Arguments for the stream.
|
|
||||||
* @param events A callback to asynchronously emit events. Invoke the
|
|
||||||
* callback with a `FlutterError` to emit an error event. Invoke the
|
|
||||||
* callback with `FlutterEndOfEventStream` to indicate that no more
|
|
||||||
* events will be emitted. Any other value, including `nil` are emitted as
|
|
||||||
* successful events.
|
|
||||||
* @return A FlutterError instance, if setup fails.
|
|
||||||
*/
|
|
||||||
- (FlutterError* _Nullable)onListenWithArguments:(id _Nullable)arguments
|
|
||||||
eventSink:(FlutterEventSink)events;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tears down an event stream.
|
|
||||||
*
|
|
||||||
* Invoked when the last listener is deregistered from the Stream associated to
|
|
||||||
* this channel on the Flutter side.
|
|
||||||
*
|
|
||||||
* The channel implementation may call this method with `nil` arguments
|
|
||||||
* to separate a pair of two consecutive set up requests. Such request pairs
|
|
||||||
* may occur during Flutter hot restart.
|
|
||||||
*
|
|
||||||
* @param arguments Arguments for the stream.
|
|
||||||
* @return A FlutterError instance, if teardown fails.
|
|
||||||
*/
|
|
||||||
- (FlutterError* _Nullable)onCancelWithArguments:(id _Nullable)arguments;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A constant used with `FlutterEventChannel` to indicate end of stream.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
extern NSObject const* FlutterEndOfEventStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A channel for communicating with the Flutter side using event streams.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterEventChannel : NSObject
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterEventChannel` with the specified name and binary messenger.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* The channel uses `FlutterStandardMethodCodec` to decode stream setup and
|
|
||||||
* teardown requests, and to encode event envelopes.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
*/
|
|
||||||
+ (instancetype)eventChannelWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterEventChannel` with the specified name, binary messenger,
|
|
||||||
* and method codec.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
* @param codec The method codec.
|
|
||||||
*/
|
|
||||||
+ (instancetype)eventChannelWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
|
|
||||||
codec:(NSObject<FlutterMethodCodec>*)codec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes a `FlutterEventChannel` with the specified name, binary messenger,
|
|
||||||
* and method codec.
|
|
||||||
*
|
|
||||||
* The channel name logically identifies the channel; identically named channels
|
|
||||||
* interfere with each other's communication.
|
|
||||||
*
|
|
||||||
* The binary messenger is a facility for sending raw, binary messages to the
|
|
||||||
* Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.
|
|
||||||
*
|
|
||||||
* @param name The channel name.
|
|
||||||
* @param messenger The binary messenger.
|
|
||||||
* @param codec The method codec.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithName:(NSString*)name
|
|
||||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger
|
|
||||||
codec:(NSObject<FlutterMethodCodec>*)codec;
|
|
||||||
/**
|
|
||||||
* Registers a handler for stream setup requests from the Flutter side.
|
|
||||||
*
|
|
||||||
* Replaces any existing handler. Use a `nil` handler for unregistering the
|
|
||||||
* existing handler.
|
|
||||||
*
|
|
||||||
* @param handler The stream handler.
|
|
||||||
*/
|
|
||||||
- (void)setStreamHandler:(NSObject<FlutterStreamHandler>* _Nullable)handler;
|
|
||||||
@end
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERCHANNELS_H_
|
|
||||||
@@ -1,411 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERCODECS_H_
|
|
||||||
#define FLUTTER_FLUTTERCODECS_H_
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
/**
|
|
||||||
A message encoding/decoding mechanism.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@protocol FlutterMessageCodec
|
|
||||||
/**
|
|
||||||
* Returns a shared instance of this `FlutterMessageCodec`.
|
|
||||||
*/
|
|
||||||
+ (instancetype)sharedInstance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encodes the specified message into binary.
|
|
||||||
*
|
|
||||||
* @param message The message.
|
|
||||||
* @return The binary encoding, or `nil`, if `message` was `nil`.
|
|
||||||
*/
|
|
||||||
- (NSData* _Nullable)encode:(id _Nullable)message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decodes the specified message from binary.
|
|
||||||
*
|
|
||||||
* @param message The message.
|
|
||||||
* @return The decoded message, or `nil`, if `message` was `nil`.
|
|
||||||
*/
|
|
||||||
- (id _Nullable)decode:(NSData* _Nullable)message;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `FlutterMessageCodec` using unencoded binary messages, represented as
|
|
||||||
* `NSData` instances.
|
|
||||||
*
|
|
||||||
* This codec is guaranteed to be compatible with the corresponding
|
|
||||||
* [BinaryCodec](https://docs.flutter.io/flutter/services/BinaryCodec-class.html)
|
|
||||||
* on the Dart side. These parts of the Flutter SDK are evolved synchronously.
|
|
||||||
*
|
|
||||||
* On the Dart side, messages are represented using `ByteData`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterBinaryCodec : NSObject <FlutterMessageCodec>
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `FlutterMessageCodec` using UTF-8 encoded `NSString` messages.
|
|
||||||
*
|
|
||||||
* This codec is guaranteed to be compatible with the corresponding
|
|
||||||
* [StringCodec](https://docs.flutter.io/flutter/services/StringCodec-class.html)
|
|
||||||
* on the Dart side. These parts of the Flutter SDK are evolved synchronously.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStringCodec : NSObject <FlutterMessageCodec>
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `FlutterMessageCodec` using UTF-8 encoded JSON messages.
|
|
||||||
*
|
|
||||||
* This codec is guaranteed to be compatible with the corresponding
|
|
||||||
* [JSONMessageCodec](https://docs.flutter.io/flutter/services/JSONMessageCodec-class.html)
|
|
||||||
* on the Dart side. These parts of the Flutter SDK are evolved synchronously.
|
|
||||||
*
|
|
||||||
* Supports values accepted by `NSJSONSerialization` plus top-level
|
|
||||||
* `nil`, `NSNumber`, and `NSString`.
|
|
||||||
*
|
|
||||||
* On the Dart side, JSON messages are handled by the JSON facilities of the
|
|
||||||
* [`dart:convert`](https://api.dartlang.org/stable/dart-convert/JSON-constant.html)
|
|
||||||
* package.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterJSONMessageCodec : NSObject <FlutterMessageCodec>
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A writer of the Flutter standard binary encoding.
|
|
||||||
*
|
|
||||||
* See `FlutterStandardMessageCodec` for details on the encoding.
|
|
||||||
*
|
|
||||||
* The encoding is extensible via subclasses overriding `writeValue`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStandardWriter : NSObject
|
|
||||||
- (instancetype)initWithData:(NSMutableData*)data;
|
|
||||||
- (void)writeByte:(UInt8)value;
|
|
||||||
- (void)writeBytes:(const void*)bytes length:(NSUInteger)length;
|
|
||||||
- (void)writeData:(NSData*)data;
|
|
||||||
- (void)writeSize:(UInt32)size;
|
|
||||||
- (void)writeAlignment:(UInt8)alignment;
|
|
||||||
- (void)writeUTF8:(NSString*)value;
|
|
||||||
- (void)writeValue:(id)value;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A reader of the Flutter standard binary encoding.
|
|
||||||
*
|
|
||||||
* See `FlutterStandardMessageCodec` for details on the encoding.
|
|
||||||
*
|
|
||||||
* The encoding is extensible via subclasses overriding `readValueOfType`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStandardReader : NSObject
|
|
||||||
- (instancetype)initWithData:(NSData*)data;
|
|
||||||
- (BOOL)hasMore;
|
|
||||||
- (UInt8)readByte;
|
|
||||||
- (void)readBytes:(void*)destination length:(NSUInteger)length;
|
|
||||||
- (NSData*)readData:(NSUInteger)length;
|
|
||||||
- (UInt32)readSize;
|
|
||||||
- (void)readAlignment:(UInt8)alignment;
|
|
||||||
- (NSString*)readUTF8;
|
|
||||||
- (id)readValue;
|
|
||||||
- (id)readValueOfType:(UInt8)type;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A factory of compatible reader/writer instances using the Flutter standard
|
|
||||||
* binary encoding or extensions thereof.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStandardReaderWriter : NSObject
|
|
||||||
- (FlutterStandardWriter*)writerWithData:(NSMutableData*)data;
|
|
||||||
- (FlutterStandardReader*)readerWithData:(NSData*)data;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `FlutterMessageCodec` using the Flutter standard binary encoding.
|
|
||||||
*
|
|
||||||
* This codec is guaranteed to be compatible with the corresponding
|
|
||||||
* [StandardMessageCodec](https://docs.flutter.io/flutter/services/StandardMessageCodec-class.html)
|
|
||||||
* on the Dart side. These parts of the Flutter SDK are evolved synchronously.
|
|
||||||
*
|
|
||||||
* Supported messages are acyclic values of these forms:
|
|
||||||
*
|
|
||||||
* - `nil` or `NSNull`
|
|
||||||
* - `NSNumber` (including their representation of Boolean values)
|
|
||||||
* - `NSString`
|
|
||||||
* - `FlutterStandardTypedData`
|
|
||||||
* - `NSArray` of supported values
|
|
||||||
* - `NSDictionary` with supported keys and values
|
|
||||||
*
|
|
||||||
* On the Dart side, these values are represented as follows:
|
|
||||||
*
|
|
||||||
* - `nil` or `NSNull`: null
|
|
||||||
* - `NSNumber`: `bool`, `int`, or `double`, depending on the contained value.
|
|
||||||
* - `NSString`: `String`
|
|
||||||
* - `FlutterStandardTypedData`: `Uint8List`, `Int32List`, `Int64List`, or `Float64List`
|
|
||||||
* - `NSArray`: `List`
|
|
||||||
* - `NSDictionary`: `Map`
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStandardMessageCodec : NSObject <FlutterMessageCodec>
|
|
||||||
+ (instancetype)codecWithReaderWriter:(FlutterStandardReaderWriter*)readerWriter;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
Command object representing a method call on a `FlutterMethodChannel`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterMethodCall : NSObject
|
|
||||||
/**
|
|
||||||
* Creates a method call for invoking the specified named method with the
|
|
||||||
* specified arguments.
|
|
||||||
*
|
|
||||||
* @param method the name of the method to call.
|
|
||||||
* @param arguments the arguments value.
|
|
||||||
*/
|
|
||||||
+ (instancetype)methodCallWithMethodName:(NSString*)method arguments:(id _Nullable)arguments;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The method name.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic) NSString* method;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The arguments.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic, nullable) id arguments;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Error object representing an unsuccessful outcome of invoking a method
|
|
||||||
* on a `FlutterMethodChannel`, or an error event on a `FlutterEventChannel`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterError : NSObject
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterError` with the specified error code, message, and details.
|
|
||||||
*
|
|
||||||
* @param code An error code string for programmatic use.
|
|
||||||
* @param message A human-readable error message.
|
|
||||||
* @param details Custom error details.
|
|
||||||
*/
|
|
||||||
+ (instancetype)errorWithCode:(NSString*)code
|
|
||||||
message:(NSString* _Nullable)message
|
|
||||||
details:(id _Nullable)details;
|
|
||||||
/**
|
|
||||||
The error code.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic) NSString* code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
The error message.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic, nullable) NSString* message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
The error details.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic, nullable) id details;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type of numeric data items encoded in a `FlutterStandardDataType`.
|
|
||||||
*
|
|
||||||
* - FlutterStandardDataTypeUInt8: plain bytes
|
|
||||||
* - FlutterStandardDataTypeInt32: 32-bit signed integers
|
|
||||||
* - FlutterStandardDataTypeInt64: 64-bit signed integers
|
|
||||||
* - FlutterStandardDataTypeFloat64: 64-bit floats
|
|
||||||
*/
|
|
||||||
typedef NS_ENUM(NSInteger, FlutterStandardDataType) {
|
|
||||||
FlutterStandardDataTypeUInt8,
|
|
||||||
FlutterStandardDataTypeInt32,
|
|
||||||
FlutterStandardDataTypeInt64,
|
|
||||||
FlutterStandardDataTypeFloat64,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A byte buffer holding `UInt8`, `SInt32`, `SInt64`, or `Float64` values, used
|
|
||||||
* with `FlutterStandardMessageCodec` and `FlutterStandardMethodCodec`.
|
|
||||||
*
|
|
||||||
* Two's complement encoding is used for signed integers. IEEE754
|
|
||||||
* double-precision representation is used for floats. The platform's native
|
|
||||||
* endianness is assumed.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStandardTypedData : NSObject
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterStandardTypedData` which interprets the specified data
|
|
||||||
* as plain bytes.
|
|
||||||
*
|
|
||||||
* @param data the byte data.
|
|
||||||
*/
|
|
||||||
+ (instancetype)typedDataWithBytes:(NSData*)data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterStandardTypedData` which interprets the specified data
|
|
||||||
* as 32-bit signed integers.
|
|
||||||
*
|
|
||||||
* @param data the byte data. The length must be divisible by 4.
|
|
||||||
*/
|
|
||||||
+ (instancetype)typedDataWithInt32:(NSData*)data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterStandardTypedData` which interprets the specified data
|
|
||||||
* as 64-bit signed integers.
|
|
||||||
*
|
|
||||||
* @param data the byte data. The length must be divisible by 8.
|
|
||||||
*/
|
|
||||||
+ (instancetype)typedDataWithInt64:(NSData*)data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a `FlutterStandardTypedData` which interprets the specified data
|
|
||||||
* as 64-bit floats.
|
|
||||||
*
|
|
||||||
* @param data the byte data. The length must be divisible by 8.
|
|
||||||
*/
|
|
||||||
+ (instancetype)typedDataWithFloat64:(NSData*)data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The raw underlying data buffer.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic) NSData* data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of the encoded values.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic) FlutterStandardDataType type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number of value items encoded.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic) UInt32 elementCount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number of bytes used by the encoding of a single value item.
|
|
||||||
*/
|
|
||||||
@property(readonly, nonatomic) UInt8 elementSize;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An arbitrarily large integer value, used with `FlutterStandardMessageCodec`
|
|
||||||
* and `FlutterStandardMethodCodec`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
FLUTTER_UNAVAILABLE("Unavailable on 2018-08-31. Deprecated on 2018-01-09. "
|
|
||||||
"FlutterStandardBigInteger was needed because the Dart 1.0 int type had no "
|
|
||||||
"size limit. With Dart 2.0, the int type is a fixed-size, 64-bit signed "
|
|
||||||
"integer. If you need to communicate larger integers, use NSString encoding "
|
|
||||||
"instead.")
|
|
||||||
@interface FlutterStandardBigInteger : NSObject
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 arguments `NSObject`,
|
|
||||||
* possibly `nil`. These data items are used to populate a `FlutterMethodCall`.
|
|
||||||
*
|
|
||||||
* 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 `NSObject`, possibly `nil`.
|
|
||||||
* In the latter case, the codec can extract an error code `NSString`, a
|
|
||||||
* human-readable `NSString` error message (possibly `nil`), and a custom
|
|
||||||
* error details `NSObject`, possibly `nil`. These data items are used to
|
|
||||||
* populate a `FlutterError`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@protocol FlutterMethodCodec
|
|
||||||
/**
|
|
||||||
* Provides access to a shared instance this codec.
|
|
||||||
*
|
|
||||||
* @return The shared instance.
|
|
||||||
*/
|
|
||||||
+ (instancetype)sharedInstance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encodes the specified method call into binary.
|
|
||||||
*
|
|
||||||
* @param methodCall The method call. The arguments value
|
|
||||||
* must be supported by this codec.
|
|
||||||
* @return The binary encoding.
|
|
||||||
*/
|
|
||||||
- (NSData*)encodeMethodCall:(FlutterMethodCall*)methodCall;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decodes the specified method call from binary.
|
|
||||||
*
|
|
||||||
* @param methodCall The method call to decode.
|
|
||||||
* @return The decoded method call.
|
|
||||||
*/
|
|
||||||
- (FlutterMethodCall*)decodeMethodCall:(NSData*)methodCall;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encodes the specified successful result into binary.
|
|
||||||
*
|
|
||||||
* @param result The result. Must be a value supported by this codec.
|
|
||||||
* @return The binary encoding.
|
|
||||||
*/
|
|
||||||
- (NSData*)encodeSuccessEnvelope:(id _Nullable)result;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encodes the specified error result into binary.
|
|
||||||
*
|
|
||||||
* @param error The error object. The error details value must be supported
|
|
||||||
* by this codec.
|
|
||||||
* @return The binary encoding.
|
|
||||||
*/
|
|
||||||
- (NSData*)encodeErrorEnvelope:(FlutterError*)error;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deccodes the specified result envelope from binary.
|
|
||||||
*
|
|
||||||
* @param envelope The error object.
|
|
||||||
* @return The result value, if the envelope represented a successful result,
|
|
||||||
* or a `FlutterError` instance, if not.
|
|
||||||
*/
|
|
||||||
- (id _Nullable)decodeEnvelope:(NSData*)envelope;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `FlutterMethodCodec` using UTF-8 encoded JSON method calls and result
|
|
||||||
* envelopes.
|
|
||||||
*
|
|
||||||
* This codec is guaranteed to be compatible with the corresponding
|
|
||||||
* [JSONMethodCodec](https://docs.flutter.io/flutter/services/JSONMethodCodec-class.html)
|
|
||||||
* on the Dart side. These parts of the Flutter SDK are evolved synchronously.
|
|
||||||
*
|
|
||||||
* Values supported as methods arguments and result payloads are
|
|
||||||
* those supported as top-level or leaf values by `FlutterJSONMessageCodec`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterJSONMethodCodec : NSObject <FlutterMethodCodec>
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `FlutterMethodCodec` using the Flutter standard binary encoding.
|
|
||||||
*
|
|
||||||
* This codec is guaranteed to be compatible with the corresponding
|
|
||||||
* [StandardMethodCodec](https://docs.flutter.io/flutter/services/StandardMethodCodec-class.html)
|
|
||||||
* on the Dart side. These parts of the Flutter SDK are evolved synchronously.
|
|
||||||
*
|
|
||||||
* Values supported as method arguments and result payloads are those supported by
|
|
||||||
* `FlutterStandardMessageCodec`.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterStandardMethodCodec : NSObject <FlutterMethodCodec>
|
|
||||||
+ (instancetype)codecWithReaderWriter:(FlutterStandardReaderWriter*)readerWriter;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERCODECS_H_
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERDARTPROJECT_H_
|
|
||||||
#define FLUTTER_FLUTTERDARTPROJECT_H_
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A set of Flutter and Dart assets used by a `FlutterEngine` to initialize execution.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterDartProject : NSObject
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes with a specific
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes with a specific set of Flutter Assets, with a specified location of
|
|
||||||
* main() and Dart packages.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL
|
|
||||||
dartMain:(NSURL*)dartMainURL
|
|
||||||
packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes from a specific set of Flutter Assets.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL
|
|
||||||
NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unavailable - use `init` instead.
|
|
||||||
*/
|
|
||||||
- (instancetype)initFromDefaultSourceForConfiguration FLUTTER_UNAVAILABLE("Use -init instead.");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @param asset The name of the asset. The name can be hierarchical.
|
|
||||||
* @return the file name to be used for lookup in the main bundle.
|
|
||||||
*/
|
|
||||||
+ (NSString*)lookupKeyForAsset:(NSString*)asset;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @param asset The name of the asset. The name can be hierarchical.
|
|
||||||
* @param package The name of the package from which the asset originates.
|
|
||||||
* @return the file name to be used for lookup in the main bundle.
|
|
||||||
*/
|
|
||||||
+ (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the default identifier for the bundle where we expect to find the Flutter Dart
|
|
||||||
* application.
|
|
||||||
*/
|
|
||||||
+ (NSString*)defaultBundleIdentifier;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERDARTPROJECT_H_
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
|
|
||||||
#define FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
#include "FlutterBinaryMessenger.h"
|
|
||||||
#include "FlutterDartProject.h"
|
|
||||||
#include "FlutterEngine.h"
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A callback for when FlutterHeadlessDartRunner has attempted to start a Dart
|
|
||||||
* Isolate in the background.
|
|
||||||
*
|
|
||||||
* @param success YES if the Isolate was started and run successfully, NO
|
|
||||||
* otherwise.
|
|
||||||
*/
|
|
||||||
typedef void (^FlutterHeadlessDartRunnerCallback)(BOOL success);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer,
|
|
||||||
* and no native drawing surface. It is appropriate for use in running Dart
|
|
||||||
* code e.g. in the background from a plugin.
|
|
||||||
*
|
|
||||||
* Most callers should prefer using `FlutterEngine` directly; this interface exists
|
|
||||||
* for legacy support.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
FLUTTER_DEPRECATED("FlutterEngine should be used rather than FlutterHeadlessDartRunner")
|
|
||||||
@interface FlutterHeadlessDartRunner : FlutterEngine
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Iniitalize this FlutterHeadlessDartRunner with a `FlutterDartProject`.
|
|
||||||
*
|
|
||||||
* If the FlutterDartProject is not specified, the FlutterHeadlessDartRunner will attempt to locate
|
|
||||||
* the project in a default location.
|
|
||||||
*
|
|
||||||
* A newly initialized engine will not run the `FlutterDartProject` until either
|
|
||||||
* `-runWithEntrypoint:` or `-runWithEntrypoint:libraryURI` is called.
|
|
||||||
*
|
|
||||||
* @param labelPrefix The label prefix used to identify threads for this instance. Should
|
|
||||||
* be unique across FlutterEngine instances
|
|
||||||
* @param projectOrNil The `FlutterDartProject` to run.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithName:(NSString*)labelPrefix
|
|
||||||
project:(FlutterDartProject*)projectOrNil NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not recommended for use - will initialize with a default label ("io.flutter.headless")
|
|
||||||
* and the default FlutterDartProject.
|
|
||||||
*/
|
|
||||||
- (instancetype)init;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERMACROS_H_
|
|
||||||
#define FLUTTER_FLUTTERMACROS_H_
|
|
||||||
|
|
||||||
#if defined(FLUTTER_FRAMEWORK)
|
|
||||||
|
|
||||||
#define FLUTTER_EXPORT __attribute__((visibility("default")))
|
|
||||||
|
|
||||||
#else // defined(FLUTTER_SDK)
|
|
||||||
|
|
||||||
#define FLUTTER_EXPORT
|
|
||||||
|
|
||||||
#endif // defined(FLUTTER_SDK)
|
|
||||||
|
|
||||||
#ifndef NS_ASSUME_NONNULL_BEGIN
|
|
||||||
#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
|
|
||||||
#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
|
|
||||||
#endif // defined(NS_ASSUME_NONNULL_BEGIN)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates that the API has been deprecated for the specified reason. Code
|
|
||||||
* that uses the deprecated API will continue to work as before. However, the
|
|
||||||
* API will soon become unavailable and users are encouraged to immediately take
|
|
||||||
* the appropriate action mentioned in the deprecation message and the BREAKING
|
|
||||||
* CHANGES section present in the Flutter.h umbrella header.
|
|
||||||
*/
|
|
||||||
#define FLUTTER_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates that the previously deprecated API is now unavailable. Code that
|
|
||||||
* uses the API will not work and the declaration of the API is only a stub
|
|
||||||
* meant to display the given message detailing the actions for the user to take
|
|
||||||
* immediately.
|
|
||||||
*/
|
|
||||||
#define FLUTTER_UNAVAILABLE(msg) __attribute__((__unavailable__(msg)))
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERMACROS_H_
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
@interface FlutterNavigationController : UINavigationController
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,343 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERPLUGIN_H_
|
|
||||||
#define FLUTTER_FLUTTERPLUGIN_H_
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#import <UserNotifications/UNUserNotificationCenter.h>
|
|
||||||
|
|
||||||
#include "FlutterBinaryMessenger.h"
|
|
||||||
#include "FlutterChannels.h"
|
|
||||||
#include "FlutterCodecs.h"
|
|
||||||
#include "FlutterPlatformViews.h"
|
|
||||||
#include "FlutterTexture.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
@protocol FlutterPluginRegistrar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
@protocol FlutterPlugin <NSObject>
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* Registers this plugin using the context information and callback registration
|
|
||||||
* methods exposed by the given registrar.
|
|
||||||
*
|
|
||||||
* The registrar is obtained from a `FlutterPluginRegistry` which keeps track of
|
|
||||||
* the identity of registered plugins and provides basic support for cross-plugin
|
|
||||||
* coordination.
|
|
||||||
*
|
|
||||||
* The caller of this method, a plugin registrant, is usually autogenerated by
|
|
||||||
* Flutter tooling based on declared plugin dependencies. The generated registrant
|
|
||||||
* asks the registry for a registrar for each plugin, and calls this method to
|
|
||||||
* allow the plugin to initialize itself and register callbacks with application
|
|
||||||
* objects available through the registrar protocol.
|
|
||||||
*
|
|
||||||
* @param registrar A helper providing application context and methods for
|
|
||||||
* registering callbacks.
|
|
||||||
*/
|
|
||||||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered to receive `FlutterMethodCall`s.
|
|
||||||
*
|
|
||||||
* @param call The method call command object.
|
|
||||||
* @param result A callback for submitting the result of the call.
|
|
||||||
*/
|
|
||||||
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `NO` if this plugin vetoes application launch.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `NO` if this plugin vetoes application launch.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
willFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)applicationDidBecomeActive:(UIApplication*)application;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)applicationWillResignActive:(UIApplication*)application;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)applicationDidEnterBackground:(UIApplication*)application;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)applicationWillEnterForeground:(UIApplication*)application;
|
|
||||||
|
|
||||||
/**
|
|
||||||
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)applicationWillTerminate:(UIApplication*)application;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
- (void)application:(UIApplication*)application
|
|
||||||
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)application:(UIApplication*)application
|
|
||||||
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
didReceiveRemoteNotification:(NSDictionary*)userInfo
|
|
||||||
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls all plugins registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)application:(UIApplication*)application
|
|
||||||
didReceiveLocalNotification:(UILocalNotification*)notification;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls all plugins registered for `UNUserNotificationCenterDelegate` callbacks.
|
|
||||||
*/
|
|
||||||
- (void)userNotificationCenter:(UNUserNotificationCenter*)center
|
|
||||||
willPresentNotification:(UNNotification*)notification
|
|
||||||
withCompletionHandler:
|
|
||||||
(void (^)(UNNotificationPresentationOptions options))completionHandler
|
|
||||||
API_AVAILABLE(ios(10));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
openURL:(NSURL*)url
|
|
||||||
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
openURL:(NSURL*)url
|
|
||||||
sourceApplication:(NSString*)sourceApplication
|
|
||||||
annotation:(id)annotation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
|
|
||||||
completionHandler:(void (^)(BOOL succeeded))completionHandler
|
|
||||||
API_AVAILABLE(ios(9.0));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
handleEventsForBackgroundURLSession:(nonnull NSString*)identifier
|
|
||||||
completionHandler:(nonnull void (^)(void))completionHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
|
||||||
*
|
|
||||||
* @return `YES` if this plugin handles the request.
|
|
||||||
*/
|
|
||||||
- (BOOL)application:(UIApplication*)application
|
|
||||||
continueUserActivity:(NSUserActivity*)userActivity
|
|
||||||
restorationHandler:(void (^)(NSArray*))restorationHandler;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
*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.
|
|
||||||
*/
|
|
||||||
@protocol FlutterPluginRegistrar <NSObject>
|
|
||||||
/**
|
|
||||||
* Returns a `FlutterBinaryMessenger` for creating Dart/iOS communication
|
|
||||||
* channels to be used by the plugin.
|
|
||||||
*
|
|
||||||
* @return The messenger.
|
|
||||||
*/
|
|
||||||
- (NSObject<FlutterBinaryMessenger>*)messenger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a `FlutterTextureRegistry` for registering textures
|
|
||||||
* provided by the plugin.
|
|
||||||
*
|
|
||||||
* @return The texture registry.
|
|
||||||
*/
|
|
||||||
- (NSObject<FlutterTextureRegistry>*)textures;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a `FlutterPlatformViewFactory` for creation of platfrom views.
|
|
||||||
*
|
|
||||||
* Plugins expose `UIView` for embedding in Flutter apps by registering a view factory.
|
|
||||||
*
|
|
||||||
* @param factory The view factory that will be registered.
|
|
||||||
* @param 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.
|
|
||||||
*/
|
|
||||||
- (void)registerViewFactory:(NSObject<FlutterPlatformViewFactory>*)factory
|
|
||||||
withId:(NSString*)factoryId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @param value The value to be published.
|
|
||||||
*/
|
|
||||||
- (void)publish:(NSObject*)value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the plugin as a receiver of incoming method calls from the Dart side
|
|
||||||
* on the specified `FlutterMethodChannel`.
|
|
||||||
*
|
|
||||||
* @param delegate The receiving object, such as the plugin's main class.
|
|
||||||
* @param channel The channel
|
|
||||||
*/
|
|
||||||
- (void)addMethodCallDelegate:(NSObject<FlutterPlugin>*)delegate
|
|
||||||
channel:(FlutterMethodChannel*)channel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the plugin as a receiver of `UIApplicationDelegate` calls.
|
|
||||||
*
|
|
||||||
* @param delegate The receiving object, such as the plugin's main class.
|
|
||||||
*/
|
|
||||||
- (void)addApplicationDelegate:(NSObject<FlutterPlugin>*)delegate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @param asset The name of the asset. The name can be hierarchical.
|
|
||||||
* @return the file name to be used for lookup in the main bundle.
|
|
||||||
*/
|
|
||||||
- (NSString*)lookupKeyForAsset:(NSString*)asset;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param asset The name of the asset. The name can be hierarchical.
|
|
||||||
* @param package The name of the package from which the asset originates.
|
|
||||||
* @return the file name to be used for lookup in the main bundle.
|
|
||||||
*/
|
|
||||||
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
@protocol FlutterPluginRegistry <NSObject>
|
|
||||||
/**
|
|
||||||
* Returns a registrar for registering a plugin.
|
|
||||||
*
|
|
||||||
* @param pluginKey The unique key identifying the plugin.
|
|
||||||
*/
|
|
||||||
- (NSObject<FlutterPluginRegistrar>*)registrarForPlugin:(NSString*)pluginKey;
|
|
||||||
/**
|
|
||||||
* Returns whether the specified plugin has been registered.
|
|
||||||
*
|
|
||||||
* @param pluginKey The unique key identifying the plugin.
|
|
||||||
* @return `YES` if `registrarForPlugin` has been called with `pluginKey`.
|
|
||||||
*/
|
|
||||||
- (BOOL)hasPlugin:(NSString*)pluginKey;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a value published by the specified plugin.
|
|
||||||
*
|
|
||||||
* @param pluginKey The unique key identifying the plugin.
|
|
||||||
* @return An object published by the plugin, if any. Will be `NSNull` if
|
|
||||||
* nothing has been published. Will be `nil` if the plugin has not been
|
|
||||||
* registered.
|
|
||||||
*/
|
|
||||||
- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implement this in the `UIAppDelegate` of your app to enable Flutter plugins to register
|
|
||||||
* themselves to the application life cycle events.
|
|
||||||
*/
|
|
||||||
@protocol FlutterAppLifeCycleProvider
|
|
||||||
- (void)addApplicationLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END;
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERPLUGIN_H_
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERTEXTURE_H_
|
|
||||||
#define FLUTTER_FLUTTERTEXTURE_H_
|
|
||||||
|
|
||||||
#import <CoreMedia/CoreMedia.h>
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@protocol FlutterTexture <NSObject>
|
|
||||||
- (CVPixelBufferRef _Nullable)copyPixelBuffer;
|
|
||||||
@end
|
|
||||||
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@protocol FlutterTextureRegistry <NSObject>
|
|
||||||
- (int64_t)registerTexture:(NSObject<FlutterTexture>*)texture;
|
|
||||||
- (void)textureFrameAvailable:(int64_t)textureId;
|
|
||||||
- (void)unregisterTexture:(int64_t)textureId;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERTEXTURE_H_
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef FLUTTER_FLUTTERVIEWCONTROLLER_H_
|
|
||||||
#define FLUTTER_FLUTTERVIEWCONTROLLER_H_
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#include "FlutterBinaryMessenger.h"
|
|
||||||
#include "FlutterDartProject.h"
|
|
||||||
#include "FlutterEngine.h"
|
|
||||||
#include "FlutterMacros.h"
|
|
||||||
#include "FlutterPlugin.h"
|
|
||||||
#include "FlutterTexture.h"
|
|
||||||
|
|
||||||
@class FlutterEngine;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A `UIViewController` implementation for Flutter views.
|
|
||||||
*
|
|
||||||
* Dart execution, channel communication, texture registration, and plugin registration
|
|
||||||
* are all handled by `FlutterEngine`. Calls on this class to those members all proxy
|
|
||||||
* through to the `FlutterEngine` attached FlutterViewController.
|
|
||||||
*
|
|
||||||
* A FlutterViewController can be initialized either with an already-running `FlutterEngine`,
|
|
||||||
* or it can be initialized with a `FlutterDartProject` that will be used to spin up
|
|
||||||
* a new `FlutterEngine`. Developers looking to present and hide FlutterViewControllers
|
|
||||||
* in native iOS applications will usually want to maintain the `FlutterEngine` instance
|
|
||||||
* so as not to lose Dart-related state and asynchronous tasks when navigating back and
|
|
||||||
* forth between a FlutterViewController and other `UIViewController`s.
|
|
||||||
*/
|
|
||||||
FLUTTER_EXPORT
|
|
||||||
@interface FlutterViewController
|
|
||||||
: UIViewController <FlutterBinaryMessenger, FlutterTextureRegistry, FlutterPluginRegistry>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes this FlutterViewController with the specified `FlutterEngine`.
|
|
||||||
*
|
|
||||||
* The initialized viewcontroller will attach itself to the engine as part of this process.
|
|
||||||
*
|
|
||||||
* @param engine The `FlutterEngine` instance to attach to.
|
|
||||||
* @param nibNameOrNil The NIB name to initialize this UIViewController with.
|
|
||||||
* @param nibBundleOrNil The NIB bundle.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithEngine:(FlutterEngine*)engine
|
|
||||||
nibName:(NSString*)nibNameOrNil
|
|
||||||
bundle:(NSBundle*)nibBundleOrNil NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes a new FlutterViewController and `FlutterEngine` with the specified
|
|
||||||
* `FlutterDartProject`.
|
|
||||||
*
|
|
||||||
* @param projectOrNil The `FlutterDartProject` to initialize the `FlutterEngine` with.
|
|
||||||
* @param nibNameOrNil The NIB name to initialize this UIViewController with.
|
|
||||||
* @param nibBundleOrNil The NIB bundle.
|
|
||||||
*/
|
|
||||||
- (instancetype)initWithProject:(FlutterDartProject*)projectOrNil
|
|
||||||
nibName:(NSString*)nibNameOrNil
|
|
||||||
bundle:(NSBundle*)nibBundleOrNil NS_DESIGNATED_INITIALIZER;
|
|
||||||
|
|
||||||
- (void)handleStatusBarTouches:(UIEvent*)event;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a callback that will be invoked when the Flutter view has been rendered.
|
|
||||||
* The callback will be fired only once.
|
|
||||||
*
|
|
||||||
* Replaces an existing callback. Use a `nil` callback to unregister the existing one.
|
|
||||||
*/
|
|
||||||
- (void)setFlutterViewDidRenderCallback:(void (^)(void))callback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @param asset The name of the asset. The name can be hierarchical.
|
|
||||||
* @return The file name to be used for lookup in the main bundle.
|
|
||||||
*/
|
|
||||||
- (NSString*)lookupKeyForAsset:(NSString*)asset;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @param asset The name of the asset. The name can be hierarchical.
|
|
||||||
* @param package The name of the package from which the asset originates.
|
|
||||||
* @return The file name to be used for lookup in the main bundle.
|
|
||||||
*/
|
|
||||||
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the first route that the Flutter app shows. The default is "/".
|
|
||||||
* This method will guarnatee that the initial route is delivered, even if the
|
|
||||||
* Flutter window hasn't been created yet when called. It cannot be used to update
|
|
||||||
* the current route being shown in a visible FlutterViewController (see pushRoute
|
|
||||||
* and popRoute).
|
|
||||||
*
|
|
||||||
* @param route The name of the first route to show.
|
|
||||||
*/
|
|
||||||
- (void)setInitialRoute:(NSString*)route;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instructs the Flutter Navigator (if any) to go back.
|
|
||||||
*/
|
|
||||||
- (void)popRoute;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instructs the Flutter Navigator (if any) to push a route on to the navigation
|
|
||||||
* stack. The setInitialRoute method should be prefered if this is called before the
|
|
||||||
* FlutterViewController has come into view.
|
|
||||||
*
|
|
||||||
* @param route The name of the route to push to the navigation stack.
|
|
||||||
*/
|
|
||||||
- (void)pushRoute:(NSString*)route;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The `FlutterPluginRegistry` used by this FlutterViewController.
|
|
||||||
*/
|
|
||||||
- (id<FlutterPluginRegistry>)pluginRegistry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the view to use as a splash screen. Flutter's rendering is asynchronous, so the first
|
|
||||||
* frame rendered by the Flutter application might not immediately appear when theFlutter view is
|
|
||||||
* initially placed in the view hierarchy. The splash screen view will be used as
|
|
||||||
* a replacement until the first frame is rendered.
|
|
||||||
*
|
|
||||||
* The view used should be appropriate for multiple sizes; an autoresizing mask to
|
|
||||||
* have a flexible width and height will be applied automatically.
|
|
||||||
*/
|
|
||||||
@property(strong, nonatomic) UIView* splashScreenView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attempts to set the `splashScreenView` property from the `UILaunchStoryboardName` from the
|
|
||||||
* main bundle's `Info.plist` file. This method will not change the value of `splashScreenView`
|
|
||||||
* if it cannot find a default one from a storyboard or nib.
|
|
||||||
*
|
|
||||||
* @return `YES` if successful, `NO` otherwise.
|
|
||||||
*/
|
|
||||||
- (BOOL)loadDefaultSplashScreenView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls whether the created view will be opaque or not.
|
|
||||||
*
|
|
||||||
* Default is `YES`. Note that setting this to `NO` may negatively impact performance
|
|
||||||
* when using hardware acceleration, and toggling this will trigger a re-layout of the
|
|
||||||
* view.
|
|
||||||
*/
|
|
||||||
@property(nonatomic, getter=isViewOpaque) BOOL viewOpaque;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif // FLUTTER_FLUTTERVIEWCONTROLLER_H_
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>Flutter</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>io.flutter.flutter</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>Flutter</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>MinimumOSVersion</key>
|
|
||||||
<string>8.0</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
framework module Flutter {
|
|
||||||
umbrella header "Flutter.h"
|
|
||||||
|
|
||||||
export *
|
|
||||||
module * { export * }
|
|
||||||
}
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user