feat: Add home route and update logout functionality in user profile bar
This commit is contained in:
parent
6a36064af7
commit
313350e1a5
@ -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',
|
||||
|
@ -205,7 +205,9 @@ class _UserProfileBarState extends State<UserProfileBar>
|
||||
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<UserProfileBar>
|
||||
await LocalStorage.logout();
|
||||
|
||||
if (mounted) {
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Row(
|
||||
|
Loading…
x
Reference in New Issue
Block a user