diff --git a/flutter_modular/lib/src/infra/services/url_service/html_url_service.dart b/flutter_modular/lib/src/infra/services/url_service/html_url_service.dart index 1f38f611..6a5b3d2c 100644 --- a/flutter_modular/lib/src/infra/services/url_service/html_url_service.dart +++ b/flutter_modular/lib/src/infra/services/url_service/html_url_service.dart @@ -12,11 +12,12 @@ class WebUrlService extends UrlService { String? getPath() { final href = window.location.href; - if (urlStrategy is HashUrlStrategy) { - if (href.endsWith(Modular.initialRoute)) { - return Modular.initialRoute; - } else if (href.contains('#')) { + if (urlStrategy is HashUrlStrategy) { + if (href.contains('#')) { return href.split('#').last; + } else if (href.endsWith(Modular.initialRoute)) { + return Modular.initialRoute; + } }