Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢冠章
flutter_boost_1.22.4
Commits
fa8ab3d0
Commit
fa8ab3d0
authored
Oct 22, 2020
by
Jim
Committed by
GitHub
Oct 22, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #890 from GelaZhang/master
解决iOS启动第一次打开Flutter页面白屏
parents
570b0a69
0d521cc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
lib/flutter_boost.dart
lib/flutter_boost.dart
+7
-13
No files found.
lib/flutter_boost.dart
View file @
fa8ab3d0
...
...
@@ -71,7 +71,8 @@ class FlutterBoost {
singleton
.
channel
.
invokeMethod
<
Map
<
dynamic
,
dynamic
>>(
'pageOnStart'
)
.
then
((
Map
<
dynamic
,
dynamic
>
_pageInfo
)
{
final
Map
<
String
,
dynamic
>
pageInfo
=
_pageInfo
?.
cast
<
String
,
dynamic
>();
final
Map
<
String
,
dynamic
>
pageInfo
=
_pageInfo
?.
cast
<
String
,
dynamic
>();
if
(
pageInfo
?.
isEmpty
??
true
)
{
return
;
}
...
...
@@ -94,18 +95,11 @@ class FlutterBoost {
PrePushRoute
prePush
,
PostPushRoute
postPush
,
})
{
if
(
Platform
.
isAndroid
)
{
onPageStart
();
}
else
if
(
Platform
.
isIOS
)
{
// TODO(AlexVincent525): 未解之谜
assert
(()
{
()
async
{
onPageStart
();
}();
return
true
;
}());
}
// 1、methodChannel didShowPageContainer 在启动的时候可能不可靠,引擎刚启动method channel可能发不到dart
// 2、Flutter 1.22之后 rootIsolate启动是异步的, methodChannel didShowPageContainer 发到dart时可能main函数还没跑完,
// 此时flutter_boost还没初始化完成,路由切换失败,导致白屏。
// 所以需要boost启动后主动取一次路由信息
onPageStart
();
return
(
BuildContext
context
,
Widget
child
)
{
assert
(
child
is
Navigator
,
'child must be Navigator, what is wrong?'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment