Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
177e043b
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,发现更多精彩内容 >>
未验证
提交
177e043b
编写于
11月 06, 2018
作者:
D
Dan Field
提交者:
GitHub
11月 06, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix setInitialRoute (#6774)
* fix setInitialRoute
上级
6fa5c0a8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
7 deletion
+24
-7
.gitignore
.gitignore
+1
-0
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
+2
-2
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
+10
-3
shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h
...form/darwin/ios/framework/Source/FlutterEngine_Internal.h
+1
-0
shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
...form/darwin/ios/framework/Source/FlutterViewController.mm
+10
-2
未找到文件。
.gitignore
浏览文件 @
177e043b
...
...
@@ -20,3 +20,4 @@ tags
Thumbs.db
.idea
pubspec.lock
.vscode/
shell/platform/darwin/ios/framework/Headers/FlutterEngine.h
浏览文件 @
177e043b
...
...
@@ -78,7 +78,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
:(
NSString
*
)
entrypoint
;
/**
* Runs a Dart program on an Isolate using the specified entrypoint and Dart library,
...
...
@@ -95,7 +95,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
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
uri
;
/**
* Sets the `FlutterViewController` for this instance. The FlutterEngine must be
...
...
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
浏览文件 @
177e043b
...
...
@@ -264,10 +264,10 @@
}));
}
-
(
bool
)
runWithEntrypoint
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
libraryURI
{
-
(
BOOL
)
createShell
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
libraryURI
{
if
(
_shell
!=
nullptr
)
{
FML_LOG
(
WARNING
)
<<
"This FlutterEngine was already invoked."
;
return
false
;
return
NO
;
}
static
size_t
shellCount
=
1
;
...
...
@@ -351,13 +351,20 @@
<<
entrypoint
.
UTF8String
;
}
else
{
[
self
maybeSetupPlatformViewChannels
];
}
return
_shell
!=
nullptr
;
}
-
(
BOOL
)
runWithEntrypoint
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
libraryURI
{
if
([
self
createShell
:
entrypoint
libraryURI
:
libraryURI
])
{
[
self
launchEngine
:
entrypoint
libraryURI
:
libraryURI
];
}
return
_shell
!=
nullptr
;
}
-
(
bool
)
runWithEntrypoint
:(
NSString
*
)
entrypoint
{
-
(
BOOL
)
runWithEntrypoint
:(
NSString
*
)
entrypoint
{
return
[
self
runWithEntrypoint
:
entrypoint
libraryURI
:
nil
];
}
...
...
shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h
浏览文件 @
177e043b
...
...
@@ -42,6 +42,7 @@
-
(
shell
::
FlutterPlatformViewsController
*
)
platformViewsController
;
-
(
FlutterTextInputPlugin
*
)
textInputPlugin
;
-
(
void
)
launchEngine
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
libraryOrNil
;
-
(
BOOL
)
createShell
:(
NSString
*
)
entrypoint
libraryURI
:(
NSString
*
)
libraryOrNil
;
@end
...
...
shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
浏览文件 @
177e043b
...
...
@@ -37,6 +37,7 @@
blink
::
ViewportMetrics
_viewportMetrics
;
BOOL
_initialized
;
BOOL
_viewOpaque
;
BOOL
_engineNeedsLaunch
;
}
#pragma mark - Manage and override all designated initializers
...
...
@@ -49,6 +50,7 @@
if
(
self
)
{
_viewOpaque
=
YES
;
_engine
.
reset
([
engine
retain
]);
_engineNeedsLaunch
=
NO
;
_flutterView
.
reset
([[
FlutterView
alloc
]
initWithDelegate
:
_engine
opaque
:
self
.
isViewOpaque
]);
_weakFactory
=
std
::
make_unique
<
fml
::
WeakPtrFactory
<
FlutterViewController
>>
(
self
);
...
...
@@ -68,8 +70,8 @@
_weakFactory
=
std
::
make_unique
<
fml
::
WeakPtrFactory
<
FlutterViewController
>>
(
self
);
_engine
.
reset
([[
FlutterEngine
alloc
]
initWithName
:
@"io.flutter"
project
:
projectOrNil
]);
_flutterView
.
reset
([[
FlutterView
alloc
]
initWithDelegate
:
_engine
opaque
:
self
.
isViewOpaque
]);
[
_engine
.
get
()
runWithEntrypoint
:
nil
];
[
_engine
.
get
()
setViewController
:
self
]
;
[
_engine
.
get
()
createShell
:
nil
libraryURI
:
nil
];
_engineNeedsLaunch
=
YES
;
[
self
performCommonViewControllerInitialization
];
}
...
...
@@ -371,6 +373,12 @@
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
TRACE_EVENT0
(
"flutter"
,
"viewWillAppear"
);
if
(
_engineNeedsLaunch
)
{
[
_engine
.
get
()
launchEngine
:
nil
libraryURI
:
nil
];
[
_engine
.
get
()
setViewController
:
self
];
_engineNeedsLaunch
=
NO
;
}
// Only recreate surface on subsequent appearances when viewport metrics are known.
// First time surface creation is done on viewDidLayoutSubviews.
if
(
_viewportMetrics
.
physical_width
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录