Skip to content

Commit

Permalink
Updated paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Nailsonseat committed Feb 13, 2024
1 parent 5f29c6a commit 3a4d33d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions frontend/lib/routes/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ 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';
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: '/',
Expand Down Expand Up @@ -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) =>
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/screens/loading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '') {
Expand Down

0 comments on commit 3a4d33d

Please sign in to comment.