@@ -21,6 +21,7 @@ import 'navigation/url_strategy.dart';
2121import 'platform_dispatcher.dart' ;
2222import 'services.dart' ;
2323import 'test_embedding.dart' ;
24+ import 'util.dart' ;
2425
2526typedef _HandleMessageCallBack = Future <bool > Function ();
2627
@@ -152,7 +153,7 @@ class EngineFlutterWindow extends ui.SingletonFlutterWindow {
152153 Future <bool > handleNavigationMessage (ByteData ? data) async {
153154 return _waitInTheLine (() async {
154155 final MethodCall decoded = const JSONMethodCodec ().decodeMethodCall (data);
155- final Map <String , dynamic >? arguments = decoded.arguments;
156+ final Map <String , dynamic >? arguments = decoded.arguments as Map < String , dynamic > ? ;
156157 switch (decoded.method) {
157158 case 'selectMultiEntryHistory' :
158159 await _useMultiEntryBrowserHistory ();
@@ -164,14 +165,14 @@ class EngineFlutterWindow extends ui.SingletonFlutterWindow {
164165 case 'routeUpdated' : // deprecated
165166 assert (arguments != null );
166167 await _useSingleEntryBrowserHistory ();
167- browserHistory.setRouteName (arguments! [ 'routeName' ] );
168+ browserHistory.setRouteName (arguments! . tryString ( 'routeName' ) );
168169 return true ;
169170 case 'routeInformationUpdated' :
170171 assert (arguments != null );
171172 browserHistory.setRouteName (
172- arguments! [ 'location' ] ,
173- state: arguments[ 'state' ] ,
174- replace: arguments[ 'replace' ] ?? false ,
173+ arguments! . tryString ( 'location' ) ,
174+ state: arguments. tryString ( 'state' ) ,
175+ replace: arguments. tryBool ( 'replace' ) ?? false ,
175176 );
176177 return true ;
177178 }
0 commit comments