Skip to content

Commit 25a3cdd

Browse files
author
caven775
committed
更新临界节点信息
1 parent fa4a570 commit 25a3cdd

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

ios/Classes/Node/DNode.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ - (void)copyWithNode:(DNode *)node
6666
self.pageType = node.pageType;
6767
self.target = node.target;
6868
self.params = node.params;
69+
self.identifier = node.identifier;
6970
}
7071

7172
+ (DNodePageType)pageTypeWithString:(NSString *)string

lib/channel/dchannel.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,10 @@ class DChannel {
7070
return _methodChannel.invokeMethod(
7171
DStackConstant.sendHomePageRoute, {"homePageRoute": route});
7272
}
73+
74+
/// 发送更新临界节点的信息
75+
Future sendUpdateBoundaryNode(Map params) {
76+
return _methodChannel.invokeMethod(
77+
DStackConstant.sendUpdateBoundaryNode, params);
78+
}
7379
}

lib/constant/constant_config.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class DStackConstant {
2727
static const String sendFlutterRootNode = "sendFlutterRootNode";
2828
static const String sendOperationNodeToFlutter = 'sendOperationNodeToFlutter';
2929
static const String sendHomePageRoute = 'sendHomePageRoute';
30+
static const String sendUpdateBoundaryNode = 'sendUpdateBoundaryNode';
3031

3132
/// 其他标识
3233
static const String nativeDidPopGesture = "nativeDidPopGesture";

lib/navigator/dnavigator_manager.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,26 @@ class DNavigatorManager {
322322
return replace(router, pageType,
323323
homePage: homePage, animated: false, params: node.params);
324324
} else {
325+
PageRoute route;
325326
bool boundary = node.boundary;
326327
if (boundary != null && boundary) {
327328
/// 临界页面不开启动画
328-
PageRoute route = DNavigatorManager.materialRoute(
329+
route = DNavigatorManager.materialRoute(
329330
routeName: router,
330331
params: params,
331332
fullscreenDialog: action == DStackConstant.present,
332333
pushAnimated: false,
333334
);
334-
return _navigator.push(route);
335335
} else {
336-
MaterialPageRoute route = DNavigatorManager.materialRoute(
336+
route = DNavigatorManager.materialRoute(
337337
routeName: router,
338338
params: params,
339339
fullscreenDialog: action == DStackConstant.present);
340-
return _navigator.push(route);
341340
}
341+
node.identifier = identifierWithRoute(route);
342+
Map json = node.toJson();
343+
DStack.instance.channel.sendUpdateBoundaryNode(json);
344+
return _navigator.push(route);
342345
}
343346
}
344347
break;

0 commit comments

Comments
 (0)