Commit 1bfc870a authored by 朱璇's avatar 朱璇

Merge branch 'revert-4c92d8a6' into 'master'

Revert "Merge branch 'zx/flutterSdk' into 'master'"

See merge request !68
parents 4c92d8a6 0eb86e85
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]}]
\ No newline at end of file
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}]},{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}]}]
\ No newline at end of file
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
No preview for this file type
......@@ -5,6 +5,52 @@
#ifndef FLUTTER_FLUTTER_H_
#define FLUTTER_FLUTTER_H_
/**
BREAKING CHANGES:
December 17, 2018:
- Changed designated initializer on FlutterEngine
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"
......
......@@ -29,8 +29,6 @@ typedef void (^FlutterBinaryReply)(NSData* _Nullable reply);
*/
typedef void (^FlutterBinaryMessageHandler)(NSData* _Nullable message, FlutterBinaryReply reply);
typedef int64_t FlutterBinaryMessengerConnection;
/**
* A facility for communicating with the Flutter side using asynchronous message
* passing with binary messages.
......@@ -74,20 +72,9 @@ FLUTTER_EXPORT
*
* @param channel The channel name.
* @param handler The message handler.
* @return An identifier that represents the connection that was just created to the channel.
*/
- (FlutterBinaryMessengerConnection)setMessageHandlerOnChannel:(NSString*)channel
binaryMessageHandler:
(FlutterBinaryMessageHandler _Nullable)handler;
/**
* Clears out a channel's message handler if that handler is still the one that
* was created as a result of
* `setMessageHandlerOnChannel:binaryMessageHandler:`.
*
* @param connection The result from `setMessageHandlerOnChannel:binaryMessageHandler:`.
*/
- (void)cleanupConnection:(FlutterBinaryMessengerConnection)connection;
- (void)setMessageHandlerOnChannel:(NSString*)channel
binaryMessageHandler:(FlutterBinaryMessageHandler _Nullable)handler;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERBINARYMESSENGER_H_
......@@ -24,11 +24,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
extern NSString* const FlutterDefaultDartEntrypoint;
/**
* The default Flutter initial route ("/").
*/
extern NSString* const FlutterDefaultInitialRoute;
/**
* The FlutterEngine class coordinates a single instance of execution for a
* `FlutterDartProject`. It may have zero or one `FlutterViewController` at a
......@@ -41,11 +36,6 @@ extern NSString* const FlutterDefaultInitialRoute;
* `FlutterViewController` instances to maintain state and/or asynchronous tasks
* (such as downloading a large file).
*
* A FlutterEngine can also be used to prewarm the Dart execution environment and reduce the
* latency of showing the Flutter screen when a `FlutterViewController` is created and presented.
* See http://flutter.dev/docs/development/add-to-app/performance for more details on loading
* performance.
*
* Alternatively, you can simply create a new `FlutterViewController` with only a
* `FlutterDartProject`. That `FlutterViewController` will internally manage its
* own instance of a FlutterEngine, but will not guarantee survival of the engine
......@@ -58,24 +48,6 @@ extern NSString* const FlutterDefaultInitialRoute;
FLUTTER_EXPORT
@interface FlutterEngine : NSObject <FlutterTextureRegistry, FlutterPluginRegistry>
/**
* Default initializer for a FlutterEngine.
*
* Threads created by this FlutterEngine will appear as "FlutterEngine #" in
* Instruments. The prefix can be customized using `initWithName`.
*
* The engine will execute the project located in the bundle with the identifier
* "io.flutter.flutter.app" (the default for Flutter projects).
*
* A newly initialized engine will not run until either `-runWithEntrypoint:` or
* `-runWithEntrypoint:libraryURI:` is called.
*
* FlutterEngine created with this method will have allowHeadlessExecution set to `YES`.
* This means that the engine will continue to run regardless of whether a `FlutterViewController`
* is attached to it or not, until `-destroyContext:` is called or the process finishes.
*/
- (instancetype)init;
/**
* Initialize this FlutterEngine.
*
......@@ -137,12 +109,17 @@ FLUTTER_EXPORT
project:(nullable FlutterDartProject*)project
allowHeadlessExecution:(BOOL)allowHeadlessExecution NS_DESIGNATED_INITIALIZER;
/**
* The default initializer is not available for this object.
* Callers must use `-[FlutterEngine initWithName:project:]`.
*/
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/**
* Runs a Dart program on an Isolate from the main Dart library (i.e. the library that
* contains `main()`), using `main()` as the entrypoint (the default for Flutter projects),
* and using "/" (the default route) as the initial route.
* contains `main()`), using `main()` as the entrypoint (the default for Flutter projects).
*
* The first call to this method will create a new Isolate. Subsequent calls will return
* immediately and have no effect.
......@@ -153,7 +130,7 @@ FLUTTER_EXPORT
/**
* Runs a Dart program on an Isolate from the main Dart library (i.e. the library that
* contains `main()`), using "/" (the default route) as the initial route.
* contains `main()`).
*
* The first call to this method will create a new Isolate. Subsequent calls will return
* immediately and have no effect.
......@@ -167,25 +144,6 @@ FLUTTER_EXPORT
*/
- (BOOL)runWithEntrypoint:(nullable NSString*)entrypoint;
/**
* Runs a Dart program on an Isolate from the main Dart library (i.e. the library that
* contains `main()`).
*
* The first call to this method will create a new Isolate. Subsequent calls will return
* immediately and have no effect.
*
* @param entrypoint The name of a top-level function from the same Dart
* library that contains the app's main() function. If this is FlutterDefaultDartEntrypoint (or
* nil), it will default to `main()`. If it is not the app's main() function, that function must
* be decorated with `@pragma(vm:entry-point)` to ensure the method is not tree-shaken by the Dart
* compiler.
* @param initialRoute The name of the initial Flutter `Navigator` `Route` to load. If this is
* FlutterDefaultInitialRoute (or nil), it will default to the "/" route.
* @return YES if the call succeeds in creating and running a Flutter Engine instance; NO otherwise.
*/
- (BOOL)runWithEntrypoint:(nullable NSString*)entrypoint
initialRoute:(nullable NSString*)initialRoute;
/**
* Runs a Dart program on an Isolate using the specified entrypoint and Dart library,
* which may not be the same as the library containing the Dart program's `main()` function.
......
......@@ -22,7 +22,7 @@
typedef void (^FlutterHeadlessDartRunnerCallback)(BOOL success);
/**
* The deprecated FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer,
* 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.
*
......
......@@ -398,7 +398,7 @@ typedef enum {
*
* @param pluginKey The unique key identifying the plugin.
*/
- (nullable NSObject<FlutterPluginRegistrar>*)registrarForPlugin:(NSString*)pluginKey;
- (NSObject<FlutterPluginRegistrar>*)registrarForPlugin:(NSString*)pluginKey;
/**
* Returns whether the specified plugin has been registered.
*
......@@ -415,7 +415,7 @@ typedef enum {
* nothing has been published. Will be `nil` if the plugin has not been
* registered.
*/
- (nullable NSObject*)valuePublishedByPlugin:(NSString*)pluginKey;
- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey;
@end
#pragma mark -
......
......@@ -35,17 +35,14 @@ extern NSNotificationName const FlutterSemanticsUpdateNotification;
* 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` via the
* `initWithEngine:` initializer, or it can be initialized with a `FlutterDartProject` that will be
* used to implicitly spin up a new `FlutterEngine`. Creating a `FlutterEngine` before showing a
* FlutterViewController can be used to pre-initialize the Dart VM and to prepare the isolate in
* order to reduce the latency to the first rendered frame. See
* https://flutter.dev/docs/development/add-to-app/performance for more details on loading
* latency.
*
* Holding a `FlutterEngine` independently of FlutterViewControllers can also be used to not to lose
* Dart-related state and asynchronous tasks when navigating back and forth between a
* FlutterViewController and other `UIViewController`s.
* A FlutterViewController can be initialized either with an already-running `FlutterEngine` via
* the `initWithEngine:` initializer, or it can be initialized with a `FlutterDartProject` that
* will be used to implicitly spin up a new `FlutterEngine`. Creating a `FlutterEngine before
* showing a `FlutterViewController` can be used to pre-initialize the Dart VM and to prepare the
* isolate in order to reduce the latency to the first rendered frame. Holding a `FlutterEngine`
* independently of FlutterViewControllers can also be used to 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 <FlutterTextureRegistry, FlutterPluginRegistry>
......@@ -55,7 +52,7 @@ FLUTTER_EXPORT
*
* The initialized viewcontroller will attach itself to the engine as part of this process.
*
* @param engine The `FlutterEngine` instance to attach to. Cannot be nil.
* @param engine The `FlutterEngine` instance to attach to.
* @param nibName The NIB name to initialize this UIViewController with.
* @param nibBundle The NIB bundle.
*/
......@@ -67,42 +64,14 @@ FLUTTER_EXPORT
* Initializes a new FlutterViewController and `FlutterEngine` with the specified
* `FlutterDartProject`.
*
* This will implicitly create a new `FlutterEngine` which is retrievable via the `engine` property
* after initialization.
*
* @param project The `FlutterDartProject` to initialize the `FlutterEngine` with.
* @param nibName The NIB name to initialize this UIViewController with.
* @param nibBundle The NIB bundle.
*/
- (instancetype)initWithProject:(nullable FlutterDartProject*)project
nibName:(nullable NSString*)nibName
bundle:(nullable NSBundle*)nibBundle NS_DESIGNATED_INITIALIZER;
/**
* Initializes a new FlutterViewController and `FlutterEngine` with the specified
* `FlutterDartProject` and `initialRoute`.
*
* This will implicitly create a new `FlutterEngine` which is retrievable via the `engine` property
* after initialization.
*
* @param project The `FlutterDartProject` to initialize the `FlutterEngine` with.
* @param initialRoute The initial `Navigator` route to load.
* @param nibName The NIB name to initialize this UIViewController with.
* @param nibBundle The NIB bundle.
*/
- (instancetype)initWithProject:(nullable FlutterDartProject*)project
initialRoute:(nullable NSString*)initialRoute
nibName:(nullable NSString*)nibName
bundle:(nullable NSBundle*)nibBundle NS_DESIGNATED_INITIALIZER;
/**
* Initializer that is called from loading a FlutterViewController from a XIB.
*
* See also:
* https://developer.apple.com/documentation/foundation/nscoding/1416145-initwithcoder?language=objc
*/
- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_DESIGNATED_INITIALIZER;
/**
* Registers a callback that will be invoked when the Flutter view has been rendered.
* The callback will be fired only once.
......@@ -134,8 +103,6 @@ FLUTTER_EXPORT
- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package;
/**
* Deprecated API to set initial route.
*
* Attempts to set the first route that the Flutter app shows if the Flutter
* runtime hasn't yet started. The default is "/".
*
......@@ -146,15 +113,9 @@ FLUTTER_EXPORT
* Setting this after the Flutter started running has no effect. See `pushRoute`
* and `popRoute` to change the route after Flutter started running.
*
* This is deprecated because it needs to be called at the time of initialization
* and thus should just be in the `initWithProject` initializer. If using
* `initWithEngine`, the initial route should be set on the engine's
* initializer.
*
* @param route The name of the first route to show.
*/
- (void)setInitialRoute:(NSString*)route
FLUTTER_DEPRECATED("Use FlutterViewController initializer to specify initial route");
- (void)setInitialRoute:(NSString*)route;
/**
* Instructs the Flutter Navigator (if any) to go back.
......@@ -163,7 +124,8 @@ FLUTTER_EXPORT
/**
* Instructs the Flutter Navigator (if any) to push a route on to the navigation
* stack.
* stack. The setInitialRoute method should be preferred if this is called before the
* FlutterViewController has come into view.
*
* @param route The name of the route to push to the navigation stack.
*/
......@@ -212,9 +174,7 @@ FLUTTER_EXPORT
@property(nonatomic, getter=isViewOpaque) BOOL viewOpaque;
/**
* The `FlutterEngine` instance for this view controller. This could be the engine this
* `FlutterViewController` is initialized with or a new `FlutterEngine` implicitly created if
* no engine was supplied during initialization.
* The `FlutterEngine` instance for this view controller.
*/
@property(weak, nonatomic, readonly) FlutterEngine* engine;
......@@ -226,17 +186,6 @@ FLUTTER_EXPORT
*/
@property(nonatomic, readonly) NSObject<FlutterBinaryMessenger>* binaryMessenger;
/**
* If the `FlutterViewController` creates a `FlutterEngine`, this property
* determines if that `FlutterEngine` has `allowHeadlessExecution` set.
*
* The intention is that this is used with the XIB. Otherwise, a
* `FlutterEngine` can just be sent to the init methods.
*
* See also: `-[FlutterEngine initWithName:project:allowHeadlessExecution:]`
*/
@property(nonatomic, readonly) BOOL engineAllowHeadlessExecution;
@end
NS_ASSUME_NONNULL_END
......
......@@ -23,8 +23,8 @@
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>FlutterEngine</key>
<string>ae90085a8437c0ae94d6b5ad2741739ebc742cb4</string>
<string>ee76268252c22f5c11e82a7b87423ca3982e51a7</string>
<key>ClangVersion</key>
<string>Apple clang version 11.0.0 (clang-1100.0.33.8)</string>
<string>Fuchsia clang version 8.0.0 (based on LLVM 8.0.0svn)</string>
</dict>
</plist>
......@@ -6,7 +6,7 @@
<dict>
<key>Headers/Flutter.h</key>
<data>
kLWQX/aWuXIsDK/JNuX3yt40MsU=
LQBk1GD+u1YEANQovLVv2R/uUag=
</data>
<key>Headers/FlutterAppDelegate.h</key>
<data>
......@@ -14,7 +14,7 @@
</data>
<key>Headers/FlutterBinaryMessenger.h</key>
<data>
jxJ6BSIQ812GchUi4HiFV/r0610=
3TKVS3KoBmkupZxin9YbnrPtMCk=
</data>
<key>Headers/FlutterCallbackCache.h</key>
<data>
......@@ -34,11 +34,11 @@
</data>
<key>Headers/FlutterEngine.h</key>
<data>
KFpiYZBq6cK6xV5YlRvg9Y4Tygk=
LJQOfMrJadCb3BZ18IdY6i8wWZQ=
</data>
<key>Headers/FlutterHeadlessDartRunner.h</key>
<data>
tgDvkYIRwTvMGj7yN6qnKdSKQCQ=
M8/dhQH3VcQVHupUxQ1dGsbG3Ek=
</data>
<key>Headers/FlutterMacros.h</key>
<data>
......@@ -50,7 +50,7 @@
</data>
<key>Headers/FlutterPlugin.h</key>
<data>
8vdSTkxMwkobUCDXADmgCLXw4qo=
iA41oFWXYC7nUQQX+BRMVxVOdnA=
</data>
<key>Headers/FlutterPluginAppLifeCycleDelegate.h</key>
<data>
......@@ -62,11 +62,11 @@
</data>
<key>Headers/FlutterViewController.h</key>
<data>
rdyDexhD1LuO/07PzM16X0gxTQc=
E4Ln9BDq+LPTdIlJi/kdpt5ZAdA=
</data>
<key>Info.plist</key>
<data>
95UIpYfnsStKLPZ88EivHi59+HM=
6Wx47HgGtA8tVVces84A4NuoAhM=
</data>
<key>Modules/module.modulemap</key>
<data>
......@@ -74,7 +74,7 @@
</data>
<key>icudtl.dat</key>
<data>
7LLymJyVsVOgMdYqN+/9Bwjbkwc=
z32dyLOVE4+TKehZcBQlHkxsxKQ=
</data>
</dict>
<key>files2</key>
......@@ -83,11 +83,11 @@
<dict>
<key>hash</key>
<data>
kLWQX/aWuXIsDK/JNuX3yt40MsU=
LQBk1GD+u1YEANQovLVv2R/uUag=
</data>
<key>hash2</key>
<data>
ln/t1JyzxFFxsnnOV3B1BHEmzr8hVu62CRIPzeZZGM8=
8ZWbAXinM+GRkpUfLzcvsat4nccJ7ZNgGrAhy0iglXs=
</data>
</dict>
<key>Headers/FlutterAppDelegate.h</key>
......@@ -105,11 +105,11 @@
<dict>
<key>hash</key>
<data>
jxJ6BSIQ812GchUi4HiFV/r0610=
3TKVS3KoBmkupZxin9YbnrPtMCk=
</data>
<key>hash2</key>
<data>
gBUV6Yaw3irZ5irFwby83/Dckmx1zIEZB4UmOTgMFms=
USlivwosbaNJJAtX2mpOdBVwZE9osgj/I3NnC9DCS04=
</data>
</dict>
<key>Headers/FlutterCallbackCache.h</key>
......@@ -160,22 +160,22 @@
<dict>
<key>hash</key>
<data>
KFpiYZBq6cK6xV5YlRvg9Y4Tygk=
LJQOfMrJadCb3BZ18IdY6i8wWZQ=
</data>
<key>hash2</key>
<data>
g3Kzolx8Gkd1LkLfBYh1JguS6nGhloRAc2Mef3n2CKk=
M4bhndP7yk3GSrTS/lp5u6/pwR6LGFou02UwSZfy94o=
</data>
</dict>
<key>Headers/FlutterHeadlessDartRunner.h</key>
<dict>
<key>hash</key>
<data>
tgDvkYIRwTvMGj7yN6qnKdSKQCQ=
M8/dhQH3VcQVHupUxQ1dGsbG3Ek=
</data>
<key>hash2</key>
<data>
gL9QAiAeZmZrvjenoxchxsQuyFxjtrFtZczZw8ORIjk=
2LUPyCMVHwKeIFZP9I5vV64Kl7unE39yisrUZVrUiVo=
</data>
</dict>
<key>Headers/FlutterMacros.h</key>
......@@ -204,11 +204,11 @@
<dict>
<key>hash</key>
<data>
8vdSTkxMwkobUCDXADmgCLXw4qo=
iA41oFWXYC7nUQQX+BRMVxVOdnA=
</data>
<key>hash2</key>
<data>
aPxJJTUy97Mu3fGBLnTFOeJoiarp0/PZ/Slygj57Ve0=
w5EgHMebCtKpo+84J4QDOp6ZvIEKx8D1UuOh/cKh5ig=
</data>
</dict>
<key>Headers/FlutterPluginAppLifeCycleDelegate.h</key>
......@@ -237,11 +237,11 @@
<dict>
<key>hash</key>
<data>
rdyDexhD1LuO/07PzM16X0gxTQc=
E4Ln9BDq+LPTdIlJi/kdpt5ZAdA=
</data>
<key>hash2</key>
<data>
m9Utsa8eCjFywFlDxPPGJ1iGWPuSW+XdSXi7QBhg17k=
YA63QxtWlRZlOhmWqBpCeK9bAbF0hoOTOQNCvIquUdI=
</data>
</dict>
<key>Modules/module.modulemap</key>
......@@ -259,11 +259,11 @@
<dict>
<key>hash</key>
<data>
7LLymJyVsVOgMdYqN+/9Bwjbkwc=
z32dyLOVE4+TKehZcBQlHkxsxKQ=
</data>
<key>hash2</key>
<data>
d6igCZs0Amnct0Ty8wttXm7vy5E4/cjjtaT/00mQRnA=
zdr5Vzvecp4snhYdlNG4xyqroPTCh6TeJWIkNMcEyTE=
</data>
</dict>
</dict>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment