Commit d6e1c919 authored by shaode.lsd's avatar shaode.lsd Committed by justin

fix hotreload时因为类型转换出错带来的白屏问题

parent 2667fd64
......@@ -70,14 +70,20 @@ class FlutterBoost {
static void onPageStart() {
WidgetsBinding.instance.addPostFrameCallback((_) {
singleton.channel.invokeMethod<Map>('pageOnStart').then((Map pageInfo) {
if (pageInfo == null || pageInfo.isEmpty) return;
if (pageInfo.containsKey("name") &&
pageInfo.containsKey("params") &&
pageInfo.containsKey("uniqueId")) {
singleton.channel
.invokeMethod<Map<dynamic, dynamic>>('pageOnStart')
.then((Map<dynamic, dynamic> pageInfo) {
if (pageInfo == null || pageInfo.isEmpty) {
return;
}
if (pageInfo.containsKey('name') &&
pageInfo.containsKey('params') &&
pageInfo.containsKey('uniqueId')) {
ContainerCoordinator.singleton.nativeContainerDidShow(
pageInfo["name"], pageInfo["params"], pageInfo["uniqueId"]);
pageInfo['name'] as String,
(pageInfo['params'] as Map<dynamic, dynamic>)
.cast<String, dynamic>(),
pageInfo['uniqueId'] as String);
}
});
});
......
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