This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ class EngineWindow extends ui.Window {
153
153
final Map <String , dynamic > message = decoded.arguments;
154
154
switch (decoded.method) {
155
155
case 'routePushed' :
156
+ case 'routeReplaced' :
156
157
_browserHistory.setRouteName (message['routeName' ]);
157
158
break ;
158
159
case 'routePopped' :
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ void main() {
22
22
engine.window.locationStrategy = _strategy = null ;
23
23
});
24
24
25
- test ('Tracks pushed and popped routes' , () {
25
+ test ('Tracks pushed, replaced and popped routes' , () {
26
26
engine.window.sendPlatformMessage (
27
27
'flutter/navigation' ,
28
28
codec.encodeMethodCall (const engine.MethodCall (
@@ -62,5 +62,18 @@ void main() {
62
62
emptyCallback,
63
63
);
64
64
expect (_strategy.path, '/bar/baz' );
65
+
66
+ engine.window.sendPlatformMessage (
67
+ 'flutter/navigation' ,
68
+ codec.encodeMethodCall (const engine.MethodCall (
69
+ 'routeReplaced' ,
70
+ < String , dynamic > {
71
+ 'previousRouteName' : '/bar/baz' ,
72
+ 'routeName' : '/bar/baz2' ,
73
+ },
74
+ )),
75
+ emptyCallback,
76
+ );
77
+ expect (_strategy.path, '/bar/baz2' );
65
78
});
66
79
}
You can’t perform that action at this time.
0 commit comments