Settings, correção de light/darkmode do dispositivo (e adição da escolha entre modos nas settings) e correção do tipo de letra no textfield do chatbot
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../../shared/presentation/pages/not_found_page.dart';
|
||||
import '../../features/settings/presentation/pages/settings_page.dart';
|
||||
import '../../features/settings/presentation/pages/profile_edit_page.dart';
|
||||
import '../../features/settings/presentation/pages/help_page.dart';
|
||||
import '../../features/auth/presentation/pages/login_page.dart';
|
||||
import '../../features/auth/presentation/pages/signup_page.dart';
|
||||
import '../../features/dashboard/presentation/pages/student_dashboard_page.dart';
|
||||
@@ -10,7 +14,6 @@ import '../../features/quiz/presentation/pages/quiz_page.dart';
|
||||
import '../../features/profile/presentation/pages/profile_page.dart';
|
||||
import '../../features/splash/presentation/pages/splash_page.dart';
|
||||
import '../../features/auth/presentation/pages/role_selection_page.dart';
|
||||
import '../../shared/presentation/pages/not_found_page.dart';
|
||||
|
||||
/// App Router Configuration
|
||||
class AppRouter {
|
||||
@@ -24,6 +27,7 @@ class AppRouter {
|
||||
static const String quizList = '/quiz';
|
||||
static const String quiz = '/quiz/:quizId';
|
||||
static const String profile = '/profile';
|
||||
static const String settings = '/settings';
|
||||
|
||||
// Nested route paths (without leading slash)
|
||||
static const String tutorNested = 'tutor';
|
||||
@@ -50,53 +54,28 @@ class AppRouter {
|
||||
builder: (context, state) => const RoleSelectionPage(),
|
||||
),
|
||||
|
||||
// Authentication Routes
|
||||
// Login
|
||||
GoRoute(
|
||||
path: login,
|
||||
name: 'login',
|
||||
builder: (context, state) {
|
||||
final selectedRole = state.uri.queryParameters['role'];
|
||||
return LoginPage(selectedRole: selectedRole);
|
||||
},
|
||||
builder: (context, state) => const LoginPage(),
|
||||
),
|
||||
|
||||
// Signup
|
||||
GoRoute(
|
||||
path: signup,
|
||||
name: 'signup',
|
||||
builder: (context, state) {
|
||||
final selectedRole = state.uri.queryParameters['role'];
|
||||
return SignupPage(selectedRole: selectedRole);
|
||||
},
|
||||
builder: (context, state) => const SignupPage(),
|
||||
),
|
||||
|
||||
// Dashboard Routes
|
||||
// Student Dashboard
|
||||
GoRoute(
|
||||
path: studentDashboard,
|
||||
name: 'studentDashboard',
|
||||
builder: (context, state) => const StudentDashboardPage(),
|
||||
routes: [
|
||||
// Nested routes for student features
|
||||
GoRoute(
|
||||
path: tutorNested,
|
||||
name: 'studentTutor',
|
||||
builder: (context, state) => const TutorChatPageSimple(),
|
||||
),
|
||||
GoRoute(
|
||||
path: quizListNested,
|
||||
name: 'quizList',
|
||||
builder: (context, state) => const QuizListPage(),
|
||||
),
|
||||
GoRoute(
|
||||
path: quizNested,
|
||||
name: 'quiz',
|
||||
builder: (context, state) {
|
||||
final quizId = state.pathParameters['quizId']!;
|
||||
return QuizPage(quizId: quizId);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// Teacher Dashboard
|
||||
GoRoute(
|
||||
path: teacherDashboard,
|
||||
name: 'teacherDashboard',
|
||||
@@ -131,6 +110,27 @@ class AppRouter {
|
||||
builder: (context, state) => const ProfilePage(),
|
||||
),
|
||||
|
||||
// Settings Route
|
||||
GoRoute(
|
||||
path: settings,
|
||||
name: 'settings',
|
||||
builder: (context, state) => const SettingsPage(),
|
||||
routes: [
|
||||
// Profile Edit Route
|
||||
GoRoute(
|
||||
path: 'profile-edit',
|
||||
name: 'profileEdit',
|
||||
builder: (context, state) => const ProfileEditPage(),
|
||||
),
|
||||
// Help Route
|
||||
GoRoute(
|
||||
path: 'help',
|
||||
name: 'help',
|
||||
builder: (context, state) => const HelpPage(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// AI Tutor Route (independent)
|
||||
GoRoute(
|
||||
path: tutor,
|
||||
@@ -179,6 +179,10 @@ class AppRouter {
|
||||
context.go(profile);
|
||||
}
|
||||
|
||||
static void goToSettings(BuildContext context) {
|
||||
context.go(settings);
|
||||
}
|
||||
|
||||
static void goBack(BuildContext context) {
|
||||
context.pop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user