From 1b0cd650764453942a0b9f2ba3a6f595a92a6980 Mon Sep 17 00:00:00 2001 From: Raimundo Melo Date: Fri, 26 Jul 2024 17:11:30 -0300 Subject: [PATCH] change-logical-check-WebUrlService --- .../src/infra/services/url_service/html_url_service.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; + } }