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: '/',
|
name: '/',
|
||||||
page: () => DashboardScreen(),
|
page: () => DashboardScreen(),
|
||||||
middlewares: [AuthMiddleware()]),
|
middlewares: [AuthMiddleware()]),
|
||||||
|
GetPage(
|
||||||
|
name: '/home',
|
||||||
|
page: () => DashboardScreen(), // or your actual home screen
|
||||||
|
middlewares: [AuthMiddleware()],
|
||||||
|
),
|
||||||
|
|
||||||
// Dashboard
|
// Dashboard
|
||||||
GetPage(
|
GetPage(
|
||||||
name: '/dashboard/attendance',
|
name: '/dashboard/attendance',
|
||||||
|
@ -205,7 +205,9 @@ class _UserProfileBarState extends State<UserProfileBar>
|
|||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () => Navigator.pop(context, true),
|
onPressed: () async {
|
||||||
|
await LocalStorage.logout();
|
||||||
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.redAccent,
|
backgroundColor: Colors.redAccent,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
@ -250,7 +252,7 @@ class _UserProfileBarState extends State<UserProfileBar>
|
|||||||
await LocalStorage.logout();
|
await LocalStorage.logout();
|
||||||
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Row(
|
content: Row(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user