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

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

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