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 84693519..42ea2333 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 @@ -22,8 +22,6 @@ class ModularRouteInformationParser final ReportPush reportPush; final UrlService urlService; - bool _firstParse = false; - ModularRouteInformationParser({ required this.getRoute, required this.getArguments, @@ -36,23 +34,17 @@ class ModularRouteInformationParser Future parseRouteInformation( RouteInformation routeInformation) async { var path = ''; - if (!_firstParse) { - // 3.10 wrapper - final location = [null].contains(routeInformation.location) - ? '/' - : routeInformation.location!; - if (location == '/') { - // ignore: invalid_use_of_visible_for_testing_member - path = urlService.getPath() ?? Modular.initialRoutePath; - } else { - // 3.10 wrapper - path = location; - } - _firstParse = true; - } else { + // 3.10 wrapper + final location = [null].contains(routeInformation.uri.path) + ? '/' + : routeInformation.uri.path; + if (location == '/') { // ignore: invalid_use_of_visible_for_testing_member path = urlService.getPath() ?? Modular.initialRoutePath; + } else { + // 3.10 wrapper + path = location; } return selectBook(path); diff --git a/shelf_modular/test/src/infra/services/bind_service_impl_test.dart b/shelf_modular/test/src/infra/services/bind_service_impl_test.dart index 2bde731a..07a7c800 100644 --- a/shelf_modular/test/src/infra/services/bind_service_impl_test.dart +++ b/shelf_modular/test/src/infra/services/bind_service_impl_test.dart @@ -18,7 +18,7 @@ void main() { }); test('should throw error not found bind', () { when(() => injector.get()).thenThrow( - const AutoInjectorException('String'), + AutoInjectorException('String'), ); expect( service.getBind().fold(id, id),