未验证 提交 3528b485 编写于 作者: S Sigurd Meldgaard 提交者: GitHub

Postpone dart initialization to -viewWillAppear on iOS (#5553)

上级 a06b790e
......@@ -167,18 +167,6 @@
return false;
}
// Launch the Dart application with the inferred run configuration.
_shell->GetTaskRunners().GetUITaskRunner()->PostTask(
fxl::MakeCopyable([engine = _shell->GetEngine(), //
config = [_dartProject.get() runConfiguration] //
]() mutable {
if (engine) {
auto result = engine->Run(std::move(config));
if (!result) {
FXL_LOG(ERROR) << "Could not launch engine with configuration.";
}
}
}));
return true;
}
......@@ -398,6 +386,20 @@
- (void)viewWillAppear:(BOOL)animated {
TRACE_EVENT0("flutter", "viewWillAppear");
// Launch the Dart application with the inferred run configuration.
_shell->GetTaskRunners().GetUITaskRunner()->PostTask(
fxl::MakeCopyable([engine = _shell->GetEngine(), //
config = [_dartProject.get() runConfiguration] //
]() mutable {
if (engine) {
auto result = engine->Run(std::move(config));
if (!result) {
FXL_LOG(ERROR) << "Could not launch engine with configuration.";
}
}
}));
// 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.
先完成此消息的编辑!
想要评论请 注册