From b1d86de5d9aa26397f2ccc6c3d286c5dde7562c9 Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 12 Sep 2023 00:50:33 +0700 Subject: [PATCH] TF-2134 Remove the leading hash(#) from the URL of web (cherry picked from commit b8869508362a4fdc65ef0b222da02474e9487fc4) --- lib/main.dart | 3 +++ lib/main/routes/route_utils.dart | 2 +- pubspec.lock | 8 ++++++++ pubspec.yaml | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 62c0fb82f..cd574cabc 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,6 +14,7 @@ import 'package:tmail_ui_user/main/localizations/localization_service.dart'; import 'package:tmail_ui_user/main/pages/app_pages.dart'; import 'package:tmail_ui_user/main/routes/app_routes.dart'; import 'package:tmail_ui_user/main/utils/app_utils.dart'; +import 'package:url_strategy/url_strategy.dart'; import 'package:worker_manager/worker_manager.dart'; void main() async { @@ -34,6 +35,8 @@ void main() async { ]); await HiveCacheConfig.initializeEncryptionKey(); + setPathUrlStrategy(); + runApp(const TMailApp()); }); } diff --git a/lib/main/routes/route_utils.dart b/lib/main/routes/route_utils.dart index d39b761d3..08ee33048 100644 --- a/lib/main/routes/route_utils.dart +++ b/lib/main/routes/route_utils.dart @@ -37,7 +37,7 @@ abstract class RouteUtils { } static Uri generateRouteBrowser(String route, NavigationRouter router) { - final baseRoutePath = '$baseOriginUrl/#$route'; + final baseRoutePath = '$baseOriginUrl$route'; ServicePath servicePath = ServicePath(baseRoutePath); if (router.emailId != null) { servicePath = servicePath.withPathParameter(router.emailId!.id.value); diff --git a/pubspec.lock b/pubspec.lock index 0e85d0963..1c3ea1be6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1692,6 +1692,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.5" + url_strategy: + dependency: "direct main" + description: + name: url_strategy + sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" + url: "https://pub.dev" + source: hosted + version: "0.2.0" uuid: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 9eb234041..3d43dd9d3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -206,6 +206,8 @@ dependencies: flutter_slidable: 3.0.0 + url_strategy: 0.2.0 + dev_dependencies: flutter_test: sdk: flutter