Harden published curriculum and student flows

This commit is contained in:
Hamza-Ayed
2026-09-30 08:22:17 +03:00
parent e8163fe265
commit ce7b0fcf14
53 changed files with 4723 additions and 3317 deletions
@@ -42,7 +42,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
@override
void didUpdateWidget(covariant UnifiedHomeScreen oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.user.gradeLevel != widget.user.gradeLevel || oldWidget.user.stream != widget.user.stream) {
if (oldWidget.user.gradeLevel != widget.user.gradeLevel ||
oldWidget.user.stream != widget.user.stream) {
_refreshData();
}
}
@@ -50,10 +51,10 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
void _refreshData() {
if (_currentRole == 'student') {
context.read<StudentCubit>().fetchLessons(
gradeLevel: widget.user.gradeLevel,
stream: widget.user.stream,
initialReadiness: widget.user.readinessScore ?? 0.0,
);
gradeLevel: widget.user.gradeLevel,
stream: widget.user.stream,
initialReadiness: widget.user.readinessScore ?? 0.0,
);
} else {
context.read<GuardianCubit>().fetchDashboard();
}
@@ -83,7 +84,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
decoration: const BoxDecoration(
color: AppColors.darkSurface,
borderRadius: BorderRadius.vertical(top: Radius.circular(28)),
border: Border(top: BorderSide(color: AppColors.darkCardBorder, width: 1.5)),
border: Border(
top: BorderSide(
color: AppColors.darkCardBorder, width: 1.5)),
),
child: SafeArea(
child: Column(
@@ -109,7 +112,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
color: AppColors.saqelCyan.withAlpha(30),
borderRadius: BorderRadius.circular(14),
),
child: const Icon(CupertinoIcons.book_fill, color: AppColors.saqelCyan, size: 24),
child: const Icon(CupertinoIcons.book_fill,
color: AppColors.saqelCyan, size: 24),
),
const SizedBox(width: 14),
const Expanded(
@@ -118,12 +122,17 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
children: [
Text(
'تحديد وتعديل الصف الدراسي 🎓',
style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.w800),
style: TextStyle(
color: Colors.white,
fontSize: 17,
fontWeight: FontWeight.w800),
),
SizedBox(height: 3),
Text(
'اختر صفك لفتح المناهج الوزارية والشروحات المعتمدة',
style: TextStyle(color: AppColors.textSecondaryDark, fontSize: 12),
style: TextStyle(
color: AppColors.textSecondaryDark,
fontSize: 12),
),
],
),
@@ -132,9 +141,21 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
const SizedBox(height: 20),
...[
('grade_10', 'الصف العاشر الأساسي (Grade 10)', 'يشمل الرياضيات المطور، الفيزياء، والإنجليزية'),
('grade_11', 'الصف الحادي عشر (الأول ثانوي)', 'المسار الأكاديمي للفرعين العلمي والأدبي'),
('grade_12', 'الصف الثاني عشر (التوجيهي الوزاري)', 'منهاج الثانوية العامة التوجيهي الوزاري'),
(
'grade_10',
'الصف العاشر الأساسي (Grade 10)',
'يشمل الرياضيات المطور، الفيزياء، والإنجليزية'
),
(
'grade_11',
'الصف الحادي عشر (الأول ثانوي)',
'المسار الأكاديمي للفرعين العلمي والأدبي'
),
(
'grade_12',
'الصف الثاني عشر (التوجيهي الوزاري)',
'منهاج الثانوية العامة التوجيهي الوزاري'
),
].map((g) {
final isSelected = tempGrade == g.$1;
return Padding(
@@ -143,44 +164,61 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
onTap: () {
setModalState(() {
tempGrade = g.$1;
if (tempGrade == 'grade_10') tempStream = 'general';
if (tempGrade == 'grade_10')
tempStream = 'general';
});
},
borderRadius: BorderRadius.circular(16),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 14),
decoration: BoxDecoration(
color: isSelected ? AppColors.saqelCyan.withAlpha(25) : AppColors.darkBackground,
color: isSelected
? AppColors.saqelCyan.withAlpha(25)
: AppColors.darkBackground,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: isSelected ? AppColors.saqelCyan : AppColors.darkCardBorder,
color: isSelected
? AppColors.saqelCyan
: AppColors.darkCardBorder,
width: isSelected ? 1.5 : 1.0,
),
),
child: Row(
children: [
Icon(
isSelected ? CupertinoIcons.checkmark_circle_fill : CupertinoIcons.circle,
color: isSelected ? AppColors.saqelCyan : AppColors.textMutedDark,
isSelected
? CupertinoIcons.checkmark_circle_fill
: CupertinoIcons.circle,
color: isSelected
? AppColors.saqelCyan
: AppColors.textMutedDark,
size: 20,
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
g.$2,
style: TextStyle(
color: isSelected ? Colors.white : AppColors.textSecondaryDark,
fontWeight: isSelected ? FontWeight.w800 : FontWeight.w600,
color: isSelected
? Colors.white
: AppColors.textSecondaryDark,
fontWeight: isSelected
? FontWeight.w800
: FontWeight.w600,
fontSize: 14,
),
),
const SizedBox(height: 2),
Text(
g.$3,
style: const TextStyle(color: AppColors.textMutedDark, fontSize: 11),
style: const TextStyle(
color: AppColors.textMutedDark,
fontSize: 11),
),
],
),
@@ -196,7 +234,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
text: 'حفظ الصف وتحديث المسار 🚀',
onPressed: () async {
Navigator.of(ctx).pop();
await context.read<AuthCubit>().updateGrade(tempGrade, stream: tempStream);
await context
.read<AuthCubit>()
.updateGrade(tempGrade, stream: tempStream);
if (mounted) {
_refreshData();
SaqelToast.showSuccess(
@@ -225,7 +265,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
body: Container(
decoration: BoxDecoration(
gradient: RadialGradient(
center: isStudent ? const Alignment(0.8, -0.6) : const Alignment(-0.8, -0.6),
center: isStudent
? const Alignment(0.8, -0.6)
: const Alignment(-0.8, -0.6),
radius: 1.3,
colors: isStudent
? const [Color(0xFF0A2540), AppColors.darkBackground]
@@ -277,7 +319,10 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
child: const Center(
child: Text(
'ص',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w900, color: Colors.black),
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w900,
color: Colors.black),
),
),
),
@@ -294,17 +339,20 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
GestureDetector(
onTap: () => _showGradeSelectionModal(context),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: AppColors.saqelCyan.withAlpha(30),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColors.saqelCyan.withAlpha(80), width: 0.8),
border: Border.all(
color: AppColors.saqelCyan.withAlpha(80), width: 0.8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
GradeLevelModel.getGradeName(widget.user.gradeLevel ?? 'grade_10'),
GradeLevelModel.getGradeName(
widget.user.gradeLevel ?? 'grade_10'),
style: const TextStyle(
color: AppColors.saqelCyan,
fontSize: 10.5,
@@ -312,7 +360,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
),
const SizedBox(width: 4),
const Icon(CupertinoIcons.chevron_down, color: AppColors.saqelCyan, size: 10),
const Icon(CupertinoIcons.chevron_down,
color: AppColors.saqelCyan, size: 10),
],
),
),
@@ -320,7 +369,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
else
Text(
AppStrings.guardianPortal,
style: AppTypography.labelSmall.copyWith(color: AppColors.textMutedDark),
style: AppTypography.labelSmall
.copyWith(color: AppColors.textMutedDark),
),
],
),
@@ -336,8 +386,10 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
child: Row(
children: [
_buildRolePill('الطالب', isStudent, () => _switchRole('student')),
_buildRolePill('ولي الأمر', !isStudent, () => _switchRole('guardian')),
_buildRolePill(
'الطالب', isStudent, () => _switchRole('student')),
_buildRolePill(
'ولي الأمر', !isStudent, () => _switchRole('guardian')),
],
),
),
@@ -345,7 +397,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
// Logout Icon
IconButton(
icon: const Icon(CupertinoIcons.power, color: AppColors.errorRed, size: 20),
icon: const Icon(CupertinoIcons.power,
color: AppColors.errorRed, size: 20),
onPressed: () => context.read<AuthCubit>().logout(),
tooltip: AppStrings.logout,
),
@@ -388,9 +441,11 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(CupertinoIcons.exclamationmark_triangle, color: AppColors.errorRed, size: 40),
const Icon(CupertinoIcons.exclamationmark_triangle,
color: AppColors.errorRed, size: 40),
const SizedBox(height: 12),
Text(state.message, style: const TextStyle(color: Colors.white)),
Text(state.message,
style: const TextStyle(color: Colors.white)),
const SizedBox(height: 16),
ElevatedButton(
onPressed: _refreshData,
@@ -412,27 +467,37 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
decoration: BoxDecoration(
color: AppColors.saqelCyan.withAlpha(25),
shape: BoxShape.circle,
border: Border.all(color: AppColors.saqelCyan.withAlpha(80), width: 1.5),
border: Border.all(
color: AppColors.saqelCyan.withAlpha(80), width: 1.5),
),
child: const Icon(CupertinoIcons.book_fill, color: AppColors.saqelCyan, size: 36),
child: const Icon(CupertinoIcons.book_fill,
color: AppColors.saqelCyan, size: 36),
),
const SizedBox(height: 18),
const Text(
'المنهاج الوزاري المعتمد — صَقِل 🇯🇴',
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w800),
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w800),
),
const SizedBox(height: 8),
const Text(
'اختر من بين 16 مبحثاً دراسياً لبدء شروحات الفيديو التفاعلية، أوراق العمل، وبنك الأسئلة المعتمد',
'لا توجد حصص تشغيل منشورة لهذا الحساب حالياً. يمكنك تصفح الدروس والموارد التي اجتازت النشر من فهرس المنهاج.',
textAlign: TextAlign.center,
style: TextStyle(color: AppColors.textSecondaryDark, fontSize: 13, height: 1.4),
style: TextStyle(
color: AppColors.textSecondaryDark,
fontSize: 13,
height: 1.4),
),
const SizedBox(height: 24),
LuxuryButton(
text: 'تصفح المناهج والمواد 📚',
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => SubjectsGridScreen(initialGrade: widget.user.gradeLevel)),
MaterialPageRoute(
builder: (_) => SubjectsGridScreen(
initialGrade: widget.user.gradeLevel)),
);
},
),
@@ -450,7 +515,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
InkWell(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => SubjectsGridScreen(initialGrade: widget.user.gradeLevel)),
MaterialPageRoute(
builder: (_) => SubjectsGridScreen(
initialGrade: widget.user.gradeLevel)),
);
},
borderRadius: BorderRadius.circular(20),
@@ -463,7 +530,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: AppColors.saqelCyan.withAlpha(100), width: 1.5),
border: Border.all(
color: AppColors.saqelCyan.withAlpha(100),
width: 1.5),
boxShadow: [
BoxShadow(
color: AppColors.saqelCyan.withAlpha(30),
@@ -479,11 +548,15 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
height: 48,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [AppColors.appleBlue, AppColors.saqelCyan],
colors: [
AppColors.appleBlue,
AppColors.saqelCyan
],
),
borderRadius: BorderRadius.circular(14),
),
child: const Icon(CupertinoIcons.square_grid_2x2_fill, color: Colors.black, size: 24),
child: const Icon(CupertinoIcons.square_grid_2x2_fill,
color: Colors.black, size: 24),
),
const SizedBox(width: 14),
const Expanded(
@@ -491,18 +564,24 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'تصفح المناهج والمواد (16 مادة) 📚',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w800, fontSize: 15),
'تصفح المناهج والمواد 📚',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 15),
),
SizedBox(height: 4),
Text(
'الرياضيات، الفيزياء، الإنجليزي، الكيمياء، والمزيد',
style: TextStyle(color: AppColors.textSecondaryDark, fontSize: 12),
style: TextStyle(
color: AppColors.textSecondaryDark,
fontSize: 12),
),
],
),
),
const Icon(CupertinoIcons.chevron_back, color: AppColors.saqelCyan, size: 18),
const Icon(CupertinoIcons.chevron_back,
color: AppColors.saqelCyan, size: 18),
],
),
),
@@ -513,7 +592,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
InkWell(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const VocationalTrainingScreen()),
MaterialPageRoute(
builder: (_) => const VocationalTrainingScreen()),
);
},
borderRadius: BorderRadius.circular(20),
@@ -526,7 +606,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: const Color(0xFF10B981).withAlpha(160), width: 1.5),
border: Border.all(
color: const Color(0xFF10B981).withAlpha(160),
width: 1.5),
boxShadow: [
BoxShadow(
color: const Color(0xFF10B981).withAlpha(35),
@@ -548,7 +630,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
borderRadius: BorderRadius.circular(14),
),
child: const Icon(CupertinoIcons.wrench_fill, color: Colors.black, size: 24),
child: const Icon(CupertinoIcons.wrench_fill,
color: Colors.black, size: 24),
),
const SizedBox(width: 14),
const Expanded(
@@ -557,17 +640,24 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
children: [
Text(
'مؤسسة التدريب المهني (VTC Hub) ⚡',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w800, fontSize: 14.5),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 14.5),
),
SizedBox(height: 4),
Text(
'140 مهنة • 8 قطاعات صناعية • مختبر فحص المركبات الكهربائية (EV)',
style: TextStyle(color: Color(0xFF6EE7B7), fontSize: 11.5, fontWeight: FontWeight.w600),
style: TextStyle(
color: Color(0xFF6EE7B7),
fontSize: 11.5,
fontWeight: FontWeight.w600),
),
],
),
),
const Icon(CupertinoIcons.chevron_back, color: Color(0xFF10B981), size: 18),
const Icon(CupertinoIcons.chevron_back,
color: Color(0xFF10B981), size: 18),
],
),
),
@@ -578,7 +668,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
InkWell(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const SmartErrorNotebookScreen()),
MaterialPageRoute(
builder: (_) => const SmartErrorNotebookScreen()),
);
},
borderRadius: BorderRadius.circular(20),
@@ -591,7 +682,9 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: const Color(0xFF8B5CF6).withOpacity(0.4), width: 1.5),
border: Border.all(
color: const Color(0xFF8B5CF6).withOpacity(0.4),
width: 1.5),
boxShadow: [
BoxShadow(
color: const Color(0xFF8B5CF6).withOpacity(0.15),
@@ -611,7 +704,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
borderRadius: BorderRadius.circular(12),
),
child: const Icon(CupertinoIcons.book_circle_fill, color: Colors.white, size: 24),
child: const Icon(CupertinoIcons.book_circle_fill,
color: Colors.white, size: 24),
),
const SizedBox(width: 14),
const Expanded(
@@ -622,24 +716,32 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
children: [
Text(
'دفتر الأخطاء الذكي والمسار العلاجي 📓',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w800, fontSize: 14),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 14),
),
SizedBox(width: 6),
Text(
'· نشط',
style: TextStyle(color: Color(0xFF34D399), fontWeight: FontWeight.w700, fontSize: 11),
style: TextStyle(
color: Color(0xFF34D399),
fontWeight: FontWeight.w700,
fontSize: 11),
),
],
),
SizedBox(height: 3),
Text(
'رصد الأسئلة المتعثرة وسد الفجوات التراكمية بالذكاء الاصطناعي',
style: TextStyle(color: Color(0xFF94A3B8), fontSize: 11.5),
style: TextStyle(
color: Color(0xFF94A3B8), fontSize: 11.5),
),
],
),
),
const Icon(CupertinoIcons.chevron_back, color: Color(0xFF8B5CF6), size: 18),
const Icon(CupertinoIcons.chevron_back,
color: Color(0xFF8B5CF6), size: 18),
],
),
),
@@ -658,17 +760,21 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
GestureDetector(
onTap: () => _showGradeSelectionModal(context),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 3),
decoration: BoxDecoration(
color: AppColors.saqelCyan.withAlpha(30),
borderRadius: BorderRadius.circular(6),
border: Border.all(color: AppColors.saqelCyan.withAlpha(80), width: 0.8),
border: Border.all(
color: AppColors.saqelCyan.withAlpha(80),
width: 0.8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
GradeLevelModel.getGradeName(widget.user.gradeLevel ?? 'grade_10'),
GradeLevelModel.getGradeName(
widget.user.gradeLevel ?? 'grade_10'),
style: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.w700,
@@ -676,7 +782,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
),
const SizedBox(width: 4),
const Icon(CupertinoIcons.pencil, color: AppColors.saqelCyan, size: 11),
const Icon(CupertinoIcons.pencil,
color: AppColors.saqelCyan, size: 11),
],
),
),
@@ -684,12 +791,15 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
const SizedBox(height: 8),
Text(
AppStrings.readinessScore,
style: AppTypography.headlineMedium.copyWith(color: Colors.white),
style: AppTypography.headlineMedium
.copyWith(color: Colors.white),
),
const SizedBox(height: 4),
Text(
'تقييم حقيقي مبني على الكويزات وفحوصات الفهم',
style: AppTypography.bodyMedium.copyWith(color: AppColors.textSecondaryDark, fontSize: 12),
style: AppTypography.bodyMedium.copyWith(
color: AppColors.textSecondaryDark,
fontSize: 12),
),
],
),
@@ -699,12 +809,16 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
height: 64,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(color: AppColors.saqelCyan, width: 3),
border:
Border.all(color: AppColors.saqelCyan, width: 3),
),
child: Center(
child: Text(
'${state.readinessScore.toStringAsFixed(0)}%',
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w900, color: Colors.white),
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w900,
color: Colors.white),
),
),
),
@@ -716,7 +830,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
// Real Lessons List from API
Text(
AppStrings.tawjihiCurriculum,
style: AppTypography.titleMedium.copyWith(color: Colors.white),
style:
AppTypography.titleMedium.copyWith(color: Colors.white),
),
const SizedBox(height: 12),
@@ -751,7 +866,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
color: AppColors.appleBlue.withAlpha(30),
borderRadius: BorderRadius.circular(12),
),
child: const Icon(CupertinoIcons.play_fill, color: AppColors.appleBlue, size: 20),
child: const Icon(CupertinoIcons.play_fill,
color: AppColors.appleBlue, size: 20),
),
const SizedBox(width: 14),
Expanded(
@@ -771,14 +887,18 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
if (lesson.isAiVersion) ...[
const SizedBox(width: 6),
Container(
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
padding: const EdgeInsets.symmetric(
horizontal: 5, vertical: 2),
decoration: BoxDecoration(
color: AppColors.adminViolet.withAlpha(40),
borderRadius: BorderRadius.circular(4),
),
child: const Text(
'ذكاء اصطناعي ✨',
style: TextStyle(fontSize: 9, fontWeight: FontWeight.w700, color: Color(0xFFA78BFA)),
style: TextStyle(
fontSize: 9,
fontWeight: FontWeight.w700,
color: Color(0xFFA78BFA)),
),
),
],
@@ -789,12 +909,16 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
lesson.title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w700, color: Colors.white),
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
color: Colors.white),
),
const SizedBox(height: 2),
Text(
lesson.formattedDuration,
style: const TextStyle(fontSize: 11, color: AppColors.textMutedDark),
style: const TextStyle(
fontSize: 11, color: AppColors.textMutedDark),
),
],
),
@@ -818,9 +942,11 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(CupertinoIcons.exclamationmark_triangle, color: AppColors.errorRed, size: 40),
const Icon(CupertinoIcons.exclamationmark_triangle,
color: AppColors.errorRed, size: 40),
const SizedBox(height: 12),
Text(state.message, style: const TextStyle(color: Colors.white)),
Text(state.message,
style: const TextStyle(color: Colors.white)),
const SizedBox(height: 16),
ElevatedButton(
onPressed: _refreshData,
@@ -834,9 +960,11 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(CupertinoIcons.person_2, color: AppColors.textMutedDark, size: 48),
const Icon(CupertinoIcons.person_2,
color: AppColors.textMutedDark, size: 48),
const SizedBox(height: 12),
Text(AppStrings.noChildrenLinked, style: const TextStyle(color: AppColors.textSecondaryDark)),
Text(AppStrings.noChildrenLinked,
style: const TextStyle(color: AppColors.textSecondaryDark)),
],
),
);
@@ -850,7 +978,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
children: [
Text(
AppStrings.linkedChildren,
style: AppTypography.titleMedium.copyWith(color: Colors.white),
style:
AppTypography.titleMedium.copyWith(color: Colors.white),
),
const SizedBox(height: 10),
@@ -861,15 +990,20 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
final child = state.children[index];
return Expanded(
child: GestureDetector(
onTap: () => context.read<GuardianCubit>().selectChild(index),
onTap: () =>
context.read<GuardianCubit>().selectChild(index),
child: Container(
margin: EdgeInsets.only(left: index == 0 ? 8 : 0),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: isSelected ? AppColors.guardianAmber.withAlpha(35) : AppColors.darkCard,
color: isSelected
? AppColors.guardianAmber.withAlpha(35)
: AppColors.darkCard,
borderRadius: BorderRadius.circular(14),
border: Border.all(
color: isSelected ? AppColors.guardianAmber : AppColors.darkCardBorder,
color: isSelected
? AppColors.guardianAmber
: AppColors.darkCardBorder,
),
),
child: Column(
@@ -880,13 +1014,17 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w700,
color: isSelected ? const Color(0xFFFBBF24) : Colors.white,
color: isSelected
? const Color(0xFFFBBF24)
: Colors.white,
),
),
const SizedBox(height: 2),
Text(
child.gradeLevel ?? 'طالب مسجل',
style: const TextStyle(fontSize: 10.5, color: AppColors.textMutedDark),
style: const TextStyle(
fontSize: 10.5,
color: AppColors.textMutedDark),
),
],
),
@@ -906,11 +1044,13 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
children: [
Text(
'تقرير الطالب: ${selectedChild.name}',
style: AppTypography.titleMedium.copyWith(color: Colors.white),
style: AppTypography.titleMedium
.copyWith(color: Colors.white),
),
const Spacer(),
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: AppColors.teacherEmerald.withAlpha(30),
borderRadius: BorderRadius.circular(6),
@@ -929,12 +1069,14 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
const SizedBox(height: 6),
Text(
'المدرسة: ${selectedChild.schoolName ?? 'مدرسة الثقافة العسكرية'}',
style: const TextStyle(fontSize: 12, color: AppColors.textMutedDark),
style: const TextStyle(
fontSize: 12, color: AppColors.textMutedDark),
),
const SizedBox(height: 16),
const Divider(color: AppColors.darkCardBorder),
const SizedBox(height: 10),
_buildGuardianStat('الامتحانات المنجزة بنجاح', '${selectedChild.examsPassed} من ${selectedChild.examsTotal}'),
_buildGuardianStat('الامتحانات المنجزة بنجاح',
'${selectedChild.examsPassed} من ${selectedChild.examsTotal}'),
InkWell(
onTap: () {
Navigator.of(context).push(
@@ -958,7 +1100,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
),
),
),
_buildGuardianStat('الرقم الوطني المشفر', selectedChild.nationalId ?? 'مسجل بالهاتف'),
_buildGuardianStat('الرقم الوطني المشفر',
selectedChild.nationalId ?? 'مسجل بالهاتف'),
],
),
),
@@ -972,7 +1115,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
builder: (ctx) => Directionality(
textDirection: TextDirection.rtl,
child: CupertinoAlertDialog(
title: const Text('ومضة التقرير الشهري لولي الأمر 📲'),
title:
const Text('ومضة التقرير الشهري لولي الأمر 📲'),
content: Text(
'🇯🇴 تقرير التحصيل الأكاديمي المعتمد\n'
'الطالب: ${selectedChild.name}\n'
@@ -999,7 +1143,8 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
borderColor: AppColors.whatsappGreen.withAlpha(90),
child: const Row(
children: [
Icon(CupertinoIcons.chat_bubble_2_fill, color: AppColors.whatsappGreen, size: 26),
Icon(CupertinoIcons.chat_bubble_2_fill,
color: AppColors.whatsappGreen, size: 26),
SizedBox(width: 12),
Expanded(
child: Column(
@@ -1009,24 +1154,33 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
children: [
Text(
'تقارير بوابة نبيه للواتساب 📲',
style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w800, color: Colors.white),
style: TextStyle(
fontSize: 13.5,
fontWeight: FontWeight.w800,
color: Colors.white),
),
SizedBox(width: 6),
Text(
'· نشطة',
style: TextStyle(color: Color(0xFF34D399), fontWeight: FontWeight.w700, fontSize: 11),
style: TextStyle(
color: Color(0xFF34D399),
fontWeight: FontWeight.w700,
fontSize: 11),
),
],
),
SizedBox(height: 3),
Text(
'انقر لمعاينة ومضة الأداء الأكاديمي الشهرية المرسلة لولي الأمر',
style: TextStyle(fontSize: 11, color: AppColors.textSecondaryDark),
style: TextStyle(
fontSize: 11,
color: AppColors.textSecondaryDark),
),
],
),
),
Icon(CupertinoIcons.chevron_back, color: AppColors.whatsappGreen, size: 16),
Icon(CupertinoIcons.chevron_back,
color: AppColors.whatsappGreen, size: 16),
],
),
),
@@ -1045,9 +1199,15 @@ class _UnifiedHomeScreenState extends State<UnifiedHomeScreen> {
padding: const EdgeInsets.only(bottom: 8),
child: Row(
children: [
Text(label, style: const TextStyle(fontSize: 12, color: AppColors.textSecondaryDark)),
Text(label,
style: const TextStyle(
fontSize: 12, color: AppColors.textSecondaryDark)),
const Spacer(),
Text(value, style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w700, color: Colors.white)),
Text(value,
style: const TextStyle(
fontSize: 12.5,
fontWeight: FontWeight.w700,
color: Colors.white)),
],
),
);