diff --git a/flutter_modular/lib/src/presenter/navigation/modular_route_information_parser.dart b/flutter_modular/lib/src/presenter/navigation/modular_route_information_parser.dart index 9a491905..9b30b8ba 100644 --- a/flutter_modular/lib/src/presenter/navigation/modular_route_information_parser.dart +++ b/flutter_modular/lib/src/presenter/navigation/modular_route_information_parser.dart @@ -120,16 +120,17 @@ class ModularRouteInformationParser } FutureOr _routeSuccess(ModularRoute? route) async { - final arguments = getArguments().getOrElse((l) => ModularArguments.empty()); + final modularArguments = + getArguments().getOrElse((l) => ModularArguments.empty()); for (var middleware in route!.middlewares) { - route = await middleware.pos(route!, arguments); + route = await middleware.pos(route!, modularArguments); if (route == null) { break; } } if (route is RedirectRoute) { - route = await selectRoute(route.to, arguments: arguments); + route = await selectRoute(route.to, arguments: modularArguments.data); } if (route != null) { diff --git a/flutter_modular/test/src/presenter/navigation/modular_route_information_parser_test.dart b/flutter_modular/test/src/presenter/navigation/modular_route_information_parser_test.dart index 6984852c..49f4e1e0 100644 --- a/flutter_modular/test/src/presenter/navigation/modular_route_information_parser_test.dart +++ b/flutter_modular/test/src/presenter/navigation/modular_route_information_parser_test.dart @@ -107,7 +107,7 @@ void main() { test('selectRoute with RedirectRoute', () async { final redirect = RedirectRoute('/oo', to: '/test'); - final args = ModularArguments.empty(); + final modularArgument = ModularArguments.empty(); final routeMock = ParallelRouteMock(); when(() => routeMock.uri).thenReturn(Uri.parse('/test')); @@ -130,11 +130,12 @@ void main() { when(() => getRoute.call(const RouteParmsDTO(url: '/oo'))) .thenAnswer((_) async => right(redirect)); - when(() => getRoute.call(RouteParmsDTO(url: '/test', arguments: args))) + when(() => getRoute + .call(RouteParmsDTO(url: '/test', arguments: modularArgument.data))) .thenAnswer((_) async => right(routeMock)); when(() => getRoute.call(const RouteParmsDTO(url: '/'))) .thenAnswer((_) async => right(routeParent)); - when(() => getArguments.call()).thenReturn(right(args)); + when(() => getArguments.call()).thenReturn(right(modularArgument)); when(() => setArguments.call(any())).thenReturn(right(unit)); @@ -143,7 +144,6 @@ void main() { expect(book.chapters().first.name, '/'); expect(book.chapters('/').first.name, '/test'); }); - test('selectRoute with resolver route withless /', () async { final args = ModularArguments.empty();