Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
8cdb3afd
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8cdb3afd
编写于
9月 08, 2019
作者:
X
xster
提交者:
GitHub
9月 08, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Annotate nullability on FlutterEngine to make swift writing more ergonomic (#11808)
上级
aa9aaa21
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
14 deletion
+32
-14
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
+27
-9
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
+5
-5
未找到文件。
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
浏览文件 @
8cdb3afd
...
...
@@ -16,6 +16,8 @@
@class
FlutterViewController
;
NS_ASSUME_NONNULL_BEGIN
/**
* The FlutterEngine class coordinates a single instance of execution for a
* `FlutterDartProject`. It may have zero or one `FlutterViewController` at a
...
...
@@ -56,9 +58,9 @@ FLUTTER_EXPORT
* @param labelPrefix The label prefix used to identify threads for this instance. Should
* be unique across FlutterEngine instances, and is used in instrumentation to label
* the threads used by this FlutterEngine.
* @param project
OrNil
The `FlutterDartProject` to run.
* @param project The `FlutterDartProject` to run.
*/
-
(
instancetype
)
initWithName
:(
NSString
*
)
labelPrefix
project
:(
FlutterDartProject
*
)
projectOrNil
;
-
(
instancetype
)
initWithName
:(
NSString
*
)
labelPrefix
project
:(
nullable
FlutterDartProject
*
)
project
;
/**
* Initialize this FlutterEngine with a `FlutterDartProject`.
...
...
@@ -73,12 +75,12 @@ FLUTTER_EXPORT
* @param labelPrefix The label prefix used to identify threads for this instance. Should
* be unique across FlutterEngine instances, and is used in instrumentation to label
* the threads used by this FlutterEngine.
* @param project
OrNil
The `FlutterDartProject` to run.
* @param project The `FlutterDartProject` to run.
* @param allowHeadlessExecution Whether or not to allow this instance to continue
* running after passing a nil `FlutterViewController` to `-setViewController:`.
*/
-
(
instancetype
)
initWithName
:(
NSString
*
)
labelPrefix
project
:(
FlutterDartProject
*
)
projectOrNil
project
:(
nullable
FlutterDartProject
*
)
project
allowHeadlessExecution
:(
BOOL
)
allowHeadlessExecution
NS_DESIGNATED_INITIALIZER
;
/**
...
...
@@ -103,7 +105,7 @@ FLUTTER_EXPORT
* tree-shaken by the Dart compiler.
* @return YES if the call succeeds in creating and running a Flutter Engine instance; NO otherwise.
*/
-
(
BOOL
)
runWithEntrypoint
:(
NSString
*
)
entrypoint
;
-
(
BOOL
)
runWithEntrypoint
:(
nullable
NSString
*
)
entrypoint
;
/**
* Runs a Dart program on an Isolate using the specified entrypoint and Dart library,
...
...
@@ -120,7 +122,7 @@ FLUTTER_EXPORT
* this will default to the same library as the `main()` function in the Dart program.
* @return YES if the call succeeds in creating and running a Flutter Engine instance; NO otherwise.
*/
-
(
BOOL
)
runWithEntrypoint
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
uri
;
-
(
BOOL
)
runWithEntrypoint
:(
nullable
NSString
*
)
entrypoint
libraryURI
:(
nullable
NSString
*
)
uri
;
/**
* Destroy running context for an engine.
...
...
@@ -177,11 +179,15 @@ FLUTTER_EXPORT
/**
* The `FlutterMethodChannel` used for localization related platform messages, such as
* setting the locale.
*
* Can be nil after `destroyContext` is called.
*/
@property
(
nonatomic
,
readonly
)
FlutterMethodChannel
*
localizationChannel
;
@property
(
nonatomic
,
readonly
,
nullable
)
FlutterMethodChannel
*
localizationChannel
;
/**
* The `FlutterMethodChannel` used for navigation related platform messages.
*
* Can be nil after `destroyContext` is called.
*
* @see [Navigation
* Channel](https://docs.flutter.io/flutter/services/SystemChannels/navigation-constant.html)
* @see [Navigator Widget](https://docs.flutter.io/flutter/widgets/Navigator-class.html)
...
...
@@ -191,6 +197,8 @@ FLUTTER_EXPORT
/**
* The `FlutterMethodChannel` used for core platform messages, such as
* information about the screen orientation.
*
* Can be nil after `destroyContext` is called.
*/
@property
(
nonatomic
,
readonly
)
FlutterMethodChannel
*
platformChannel
;
...
...
@@ -198,6 +206,8 @@ FLUTTER_EXPORT
* The `FlutterMethodChannel` used to communicate text input events to the
* Dart Isolate.
*
* Can be nil after `destroyContext` is called.
*
* @see [Text Input
* Channel](https://docs.flutter.io/flutter/services/SystemChannels/textInput-constant.html)
*/
...
...
@@ -207,6 +217,8 @@ FLUTTER_EXPORT
* The `FlutterBasicMessageChannel` used to communicate app lifecycle events
* to the Dart Isolate.
*
* Can be nil after `destroyContext` is called.
*
* @see [Lifecycle
* Channel](https://docs.flutter.io/flutter/services/SystemChannels/lifecycle-constant.html)
*/
...
...
@@ -216,6 +228,8 @@ FLUTTER_EXPORT
* The `FlutterBasicMessageChannel` used for communicating system events, such as
* memory pressure events.
*
* Can be nil after `destroyContext` is called.
*
* @see [System
* Channel](https://docs.flutter.io/flutter/services/SystemChannels/system-constant.html)
*/
...
...
@@ -224,6 +238,8 @@ FLUTTER_EXPORT
/**
* The `FlutterBasicMessageChannel` used for communicating user settings such as
* clock format and text scale.
*
* Can be nil after `destroyContext` is called.
*/
@property
(
nonatomic
,
readonly
)
FlutterBasicMessageChannel
*
settingsChannel
;
...
...
@@ -234,7 +250,7 @@ FLUTTER_EXPORT
* observatory service is ready. In release mode or before the observatory has
* started, it returns `nil`.
*/
@property
(
nonatomic
,
readonly
)
NSURL
*
observatoryUrl
;
@property
(
nonatomic
,
readonly
,
nullable
)
NSURL
*
observatoryUrl
;
/**
* The `FlutterBinaryMessenger` associated with this FlutterEngine (used for communicating with
...
...
@@ -247,8 +263,10 @@ FLUTTER_EXPORT
*
* This property will be nil if the engine is not running.
*/
@property
(
nonatomic
,
readonly
,
copy
)
NSString
*
isolateId
;
@property
(
nonatomic
,
readonly
,
copy
,
nullable
)
NSString
*
isolateId
;
@end
NS_ASSUME_NONNULL_END
#endif // FLUTTER_FLUTTERENGINE_H_
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
浏览文件 @
8cdb3afd
...
...
@@ -69,12 +69,12 @@
FlutterBinaryMessengerRelay
*
_binaryMessenger
;
}
-
(
instancetype
)
initWithName
:(
NSString
*
)
labelPrefix
project
:(
FlutterDartProject
*
)
project
OrNil
{
return
[
self
initWithName
:
labelPrefix
project
:
project
OrNil
allowHeadlessExecution
:
YES
];
-
(
instancetype
)
initWithName
:(
NSString
*
)
labelPrefix
project
:(
FlutterDartProject
*
)
project
{
return
[
self
initWithName
:
labelPrefix
project
:
project
allowHeadlessExecution
:
YES
];
}
-
(
instancetype
)
initWithName
:(
NSString
*
)
labelPrefix
project
:(
FlutterDartProject
*
)
project
OrNil
project
:(
FlutterDartProject
*
)
project
allowHeadlessExecution
:(
BOOL
)
allowHeadlessExecution
{
self
=
[
super
init
];
NSAssert
(
self
,
@"Super init cannot be nil"
);
...
...
@@ -85,10 +85,10 @@
_weakFactory
=
std
::
make_unique
<
fml
::
WeakPtrFactory
<
FlutterEngine
>>
(
self
);
if
(
project
OrNil
==
nil
)
if
(
project
==
nil
)
_dartProject
.
reset
([[
FlutterDartProject
alloc
]
init
]);
else
_dartProject
.
reset
([
project
OrNil
retain
]);
_dartProject
.
reset
([
project
retain
]);
_pluginPublications
=
[
NSMutableDictionary
new
];
_platformViewsController
.
reset
(
new
flutter
::
FlutterPlatformViewsController
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录