From 313350e1a5215b0b8b427374c185db246eaa90c0 Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Wed, 11 Jun 2025 20:25:01 +0530 Subject: [PATCH] feat: Add home route and update logout functionality in user profile bar --- lib/routes.dart | 6 ++++++ lib/view/layouts/user_profile_right_bar.dart | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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(