From 8bddd57d195d253dcf489c4030ccc25dd4227ef9 Mon Sep 17 00:00:00 2001 From: Moe Date: Sat, 21 May 2022 17:11:27 +0700 Subject: [PATCH] Update routing --- lib/components/menu.dart | 4 ++-- lib/utils/navigation_auth.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/components/menu.dart b/lib/components/menu.dart index 4e72586..cb63be0 100644 --- a/lib/components/menu.dart +++ b/lib/components/menu.dart @@ -71,13 +71,13 @@ class _MenuState extends State { } }); } else if (index == 1) { - html.window.history.pushState(null, '', '/products'); + html.window.history.pushState(null, '', '/#/products'); _selectedWidget = const Products(); } else if (index == 2) { html.window.history.pushState(null, '', ''); _selectedWidget = const Home(); } else if (index == 3) { - html.window.history.pushState(null, '', '/cart'); + html.window.history.pushState(null, '', '/#/cart'); _selectedWidget = const Cart(); } else if (index == 4) { checkSessionExist().then((isLoggedIn) { diff --git a/lib/utils/navigation_auth.dart b/lib/utils/navigation_auth.dart index d724073..affb02e 100644 --- a/lib/utils/navigation_auth.dart +++ b/lib/utils/navigation_auth.dart @@ -20,7 +20,7 @@ class NavigationAuth extends StatelessWidget { if (data) { return route; } else { - html.window.history.pushState(null, '', '/login'); + html.window.history.pushState(null, '', '/#/login'); return const Login(); } } else {