From 3a4d33dd2f01faed9349015bc82ea173e48843e9 Mon Sep 17 00:00:00 2001 From: nailsonseat Date: Tue, 13 Feb 2024 17:53:10 +0530 Subject: [PATCH] Updated paths --- frontend/lib/routes/routes.dart | 21 +++++++++++++++------ frontend/lib/screens/loading_page.dart | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/frontend/lib/routes/routes.dart b/frontend/lib/routes/routes.dart index 7585b3d..20d9979 100644 --- a/frontend/lib/routes/routes.dart +++ b/frontend/lib/routes/routes.dart @@ -7,8 +7,7 @@ import 'package:smart_insti_app/screens/admin/manage_rooms.dart'; import 'package:smart_insti_app/screens/admin/view_students.dart'; import 'package:smart_insti_app/screens/auth/login_general.dart'; import 'package:smart_insti_app/screens/loading_page.dart'; -import 'package:smart_insti_app/screens/home.dart'; -import 'package:smart_insti_app/screens/lost_and_found.dart'; +import 'package:smart_insti_app/screens/user/lost_and_found.dart'; import '../screens/admin/add_faculty.dart'; import '../screens/admin/add_menu.dart'; import '../screens/admin/admin_profile.dart'; @@ -16,13 +15,13 @@ import '../screens/admin/view_courses.dart'; import '../screens/admin/view_faculty.dart'; import '../screens/admin/view_menu.dart'; import '../screens/auth/admin_login.dart'; -import '../screens/room_vacancy.dart'; +import '../screens/user/room_vacancy.dart'; import '../screens/user/user_home.dart'; import '../screens/user/faculty_profile.dart'; import '../screens/user/student_profile.dart'; final GoRouter routes = GoRouter( - initialLocation: '/', + initialLocation: '/user_home', routes: [ GoRoute( path: '/', @@ -86,9 +85,19 @@ final GoRouter routes = GoRouter( ], ), GoRoute( - path: '/home', - pageBuilder: (context, state) => const MaterialPage(child: Home()), + path: '/user_home', + pageBuilder: (context, state) => const MaterialPage(child: UserHome()), routes: [ + GoRoute( + path: 'faculty_profile', + pageBuilder: (context, state) => + const MaterialPage(child: FacultyProfile()), + ), + GoRoute( + path: 'student_profile', + pageBuilder: (context, state) => + const MaterialPage(child: StudentProfile()), + ), GoRoute( path: 'room_vacancy', pageBuilder: (context, state) => diff --git a/frontend/lib/screens/loading_page.dart b/frontend/lib/screens/loading_page.dart index 5d3375f..284e79b 100644 --- a/frontend/lib/screens/loading_page.dart +++ b/frontend/lib/screens/loading_page.dart @@ -25,7 +25,7 @@ class LoadingPage extends ConsumerWidget { return Container(); } else if (snapshot.data == 'student' || snapshot.data == 'faculty') { WidgetsBinding.instance.addPostFrameCallback((_) { - context.go('/home'); + context.go('/user_home'); }); return Container(); } else if (snapshot.data == '') {