Adds new route annoucement method. (flutter/engine#16523)
This commit is contained in:
@@ -200,6 +200,7 @@ class EngineWindow extends ui.Window {
|
||||
final MethodCall decoded = codec.decodeMethodCall(data);
|
||||
final Map<String, dynamic> message = decoded.arguments;
|
||||
switch (decoded.method) {
|
||||
case 'routeUpdated':
|
||||
case 'routePushed':
|
||||
case 'routeReplaced':
|
||||
_browserHistory.setRouteName(message['routeName']);
|
||||
|
||||
@@ -75,5 +75,15 @@ void main() {
|
||||
emptyCallback,
|
||||
);
|
||||
expect(_strategy.path, '/bar/baz2');
|
||||
|
||||
engine.window.sendPlatformMessage(
|
||||
'flutter/navigation',
|
||||
codec.encodeMethodCall(const engine.MethodCall(
|
||||
'routeUpdated',
|
||||
<String, dynamic>{'previousRouteName': '/bar/baz2', 'routeName': '/foo/foo/2'},
|
||||
)),
|
||||
emptyCallback,
|
||||
);
|
||||
expect(_strategy.path, '/foo/foo/2');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user