diff --git a/lib/routes.dart b/lib/routes.dart index 0c93767..a1a9e06 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -36,6 +36,12 @@ getPageRoute() { name: '/', page: () => DashboardScreen(), middlewares: [AuthMiddleware()]), + GetPage( + name: '/home', + page: () => DashboardScreen(), // or your actual home screen + middlewares: [AuthMiddleware()], + ), + // Dashboard GetPage( name: '/dashboard/attendance', diff --git a/lib/view/layouts/user_profile_right_bar.dart b/lib/view/layouts/user_profile_right_bar.dart index 60130ce..265a102 100644 --- a/lib/view/layouts/user_profile_right_bar.dart +++ b/lib/view/layouts/user_profile_right_bar.dart @@ -205,7 +205,9 @@ class _UserProfileBarState extends State const SizedBox(width: 12), Expanded( child: ElevatedButton( - onPressed: () => Navigator.pop(context, true), + onPressed: () async { + await LocalStorage.logout(); + }, style: ElevatedButton.styleFrom( backgroundColor: Colors.redAccent, foregroundColor: Colors.white, @@ -250,7 +252,7 @@ class _UserProfileBarState extends State await LocalStorage.logout(); if (mounted) { - Navigator.pop(context); + Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Row(