diff --git a/flutter_modular/CHANGELOG.md b/flutter_modular/CHANGELOG.md index c029e706..990a9837 100644 --- a/flutter_modular/CHANGELOG.md +++ b/flutter_modular/CHANGELOG.md @@ -1,5 +1,5 @@ -## [6.3.4] - 2025-03-31 -- FIX: prevent navigation block when device time is adjusted backward +## [6.3.4] - 2025-05-02 +- Fix Deep Link query parameters ## [6.3.3] - 2024-04-08 - Fix Deep Link 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 703a5efe..419e57ef 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 @@ -55,7 +55,10 @@ class ModularRouteInformationParser path = location; } - return selectBook(path); + return selectBook( + path, + arguments: routeInformation.uri.queryParameters, + ); } @override 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 a5d86493..d2da93d3 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 @@ -82,6 +82,27 @@ void main() { expect(book.chapters().first.name, '/'); }); + test('parseRouteInformation calls selectBook with correct arguments', + () async { + final routeMock = ParallelRouteMock(); + final params = {'param': 'value'}; + final uri = Uri.parse('/test'); + when(() => routeMock.uri).thenReturn(uri); + when(() => routeMock.parent).thenReturn(''); + when(() => routeMock.middlewares).thenReturn([]); + when(() => getRoute.call(any())) + .thenAnswer((_) async => Success(routeMock)); + when(() => getArguments.call()) + .thenReturn(Success(ModularArguments(uri: uri, data: params))); + when(() => reportPush(routeMock)).thenReturn(const Success(unit)); + + const routeInformation = RouteInformation(location: '/test?param=value'); + final book = await parser.parseRouteInformation(routeInformation); + + expect(book.uri.toString(), '/test'); + expect(parser.getArguments.call().getOrNull()?.data, params); + }); + test('selectBook with parents', () async { final routeMock = ParallelRouteMock(); when(() => routeMock.uri).thenReturn(Uri.parse('/test'));