Update Saqel Platform: 2026-09-08 18:19:28

This commit is contained in:
Hamza-Ayed
2026-09-08 18:19:28 +03:00
parent 75451ebc3f
commit e5cbd89323
22 changed files with 1537 additions and 595 deletions
@@ -32,7 +32,8 @@ class TeacherMainShell extends StatefulWidget {
class _TeacherMainShellState extends State<TeacherMainShell> {
int _currentTabIndex = 0;
void _openEditProfileDialog(BuildContext context, TeacherProfileModel profile) {
void _openEditProfileDialog(
BuildContext context, TeacherProfileModel profile) {
final nameCtrl = TextEditingController(text: profile.name);
final subjectCtrl = TextEditingController(text: profile.specialization);
final schoolCtrl = TextEditingController(text: profile.schoolName);
@@ -64,7 +65,9 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
decoration: const BoxDecoration(
color: TeacherTheme.surfaceDark,
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
border: Border(top: BorderSide(color: TeacherTheme.emeraldPrimary, width: 2)),
border: Border(
top:
BorderSide(color: TeacherTheme.emeraldPrimary, width: 2)),
),
child: SingleChildScrollView(
child: Column(
@@ -73,37 +76,56 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
children: [
Row(
children: [
const Icon(CupertinoIcons.pencil_circle_fill, color: TeacherTheme.emeraldPrimary, size: 28),
const Icon(CupertinoIcons.pencil_circle_fill,
color: TeacherTheme.emeraldPrimary, size: 28),
const SizedBox(width: 10),
const Text(
'تحديث بيانات المعلم والصفوف والمباحث 📋',
style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w800),
style: TextStyle(
color: Colors.white,
fontSize: 15,
fontWeight: FontWeight.w800),
),
const Spacer(),
IconButton(
onPressed: () => Navigator.of(ctx).pop(),
icon: const Icon(CupertinoIcons.xmark_circle_fill, color: Colors.white54, size: 20),
icon: const Icon(CupertinoIcons.xmark_circle_fill,
color: Colors.white54, size: 20),
),
],
),
const SizedBox(height: 16),
const Text('الاسم المعتمد:', style: TextStyle(color: Colors.white70, fontSize: 12, fontWeight: FontWeight.bold)),
const Text('الاسم المعتمد:',
style: TextStyle(
color: Colors.white70,
fontSize: 12,
fontWeight: FontWeight.bold)),
const SizedBox(height: 6),
_buildInputBox(controller: nameCtrl, hint: 'الاسم الكامل'),
const SizedBox(height: 12),
const Text('المادة التخصصية:', style: TextStyle(color: Colors.white70, fontSize: 12, fontWeight: FontWeight.bold)),
const Text('المادة التخصصية:',
style: TextStyle(
color: Colors.white70,
fontSize: 12,
fontWeight: FontWeight.bold)),
const SizedBox(height: 6),
_buildInputBox(controller: subjectCtrl, hint: 'المادة (مثال: الفيزياء)'),
_buildInputBox(
controller: subjectCtrl, hint: 'المادة (مثال: الفيزياء)'),
const SizedBox(height: 12),
const Text('المدرسة / المديرية:', style: TextStyle(color: Colors.white70, fontSize: 12, fontWeight: FontWeight.bold)),
const Text('المدرسة / المديرية:',
style: TextStyle(
color: Colors.white70,
fontSize: 12,
fontWeight: FontWeight.bold)),
const SizedBox(height: 6),
_buildInputBox(controller: schoolCtrl, hint: 'المدرسة التابع لها'),
_buildInputBox(
controller: schoolCtrl, hint: 'المدرسة التابع لها'),
const SizedBox(height: 14),
const Text('الصفوف والشعب التي تدرسها في المنصة:', style: TextStyle(color: Colors.white70, fontSize: 12, fontWeight: FontWeight.bold)),
const Text('الصفوف والشعب التي تدرسها في المنصة:',
style: TextStyle(
color: Colors.white70,
fontSize: 12,
fontWeight: FontWeight.bold)),
const SizedBox(height: 8),
Wrap(
spacing: 8,
@@ -112,11 +134,18 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
final isSelected = selectedGrades.contains(grade);
return FilterChip(
selected: isSelected,
label: Text(grade, style: TextStyle(color: isSelected ? Colors.black : Colors.white, fontSize: 11.5, fontWeight: FontWeight.bold)),
label: Text(grade,
style: TextStyle(
color: isSelected ? Colors.black : Colors.white,
fontSize: 11.5,
fontWeight: FontWeight.bold)),
selectedColor: TeacherTheme.emeraldPrimary,
backgroundColor: TeacherTheme.surfaceCard,
checkmarkColor: Colors.black,
side: BorderSide(color: isSelected ? TeacherTheme.emeraldPrimary : TeacherTheme.surfaceBorder),
side: BorderSide(
color: isSelected
? TeacherTheme.emeraldPrimary
: TeacherTheme.surfaceBorder),
onSelected: (selected) {
setModalState(() {
if (selected) {
@@ -132,7 +161,6 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
}).toList(),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
context.read<TeacherAuthCubit>().updateProfile(
@@ -143,15 +171,19 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
bio: bioCtrl.text.trim(),
);
Navigator.of(ctx).pop();
SaqelToast.showSuccess(context, 'تم تحديث بيانات المعلم والصفوف بنجاح ✨');
SaqelToast.showSuccess(
context, 'تم تحديث بيانات المعلم والصفوف بنجاح ✨');
},
style: ElevatedButton.styleFrom(
backgroundColor: TeacherTheme.emeraldPrimary,
foregroundColor: Colors.black,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
),
child: const Text('حفظ التعديلات واعتماد الملف 💾', style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w900)),
child: const Text('حفظ التعديلات واعتماد الملف 💾',
style: TextStyle(
fontSize: 13.5, fontWeight: FontWeight.w900)),
),
],
),
@@ -162,7 +194,8 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
);
}
Widget _buildInputBox({required TextEditingController controller, required String hint}) {
Widget _buildInputBox(
{required TextEditingController controller, required String hint}) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 2),
decoration: BoxDecoration(
@@ -173,7 +206,10 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
child: TextField(
controller: controller,
style: const TextStyle(color: Colors.white, fontSize: 13),
decoration: InputDecoration(border: InputBorder.none, hintText: hint, hintStyle: const TextStyle(color: Color(0xFF64748B), fontSize: 12)),
decoration: InputDecoration(
border: InputBorder.none,
hintText: hint,
hintStyle: const TextStyle(color: Color(0xFF64748B), fontSize: 12)),
),
);
}
@@ -185,7 +221,8 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
textDirection: TextDirection.rtl,
child: CupertinoAlertDialog(
title: const Text('تسجيل الخروج من استوديو المعلم 🚪'),
content: const Text('هل أنت متأكد من رغبتك في إنهاء جلسة العمل الحالية؟'),
content:
const Text('هل أنت متأكد من رغبتك في إنهاء جلسة العمل الحالية؟'),
actions: [
CupertinoDialogAction(
onPressed: () => Navigator.of(ctx).pop(),
@@ -224,7 +261,9 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
profile = authState.profile;
}
final initialLetter = profile.name.isNotEmpty ? profile.name.trim().characters.first : 'م';
final initialLetter = profile.name.isNotEmpty
? profile.name.trim().characters.first
: 'م';
return Directionality(
textDirection: TextDirection.rtl,
@@ -242,7 +281,10 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
height: 38,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [TeacherTheme.emeraldPrimary, TeacherTheme.emeraldDark],
colors: [
TeacherTheme.emeraldPrimary,
TeacherTheme.emeraldDark
],
),
borderRadius: BorderRadius.circular(10),
),
@@ -276,12 +318,14 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
),
),
const SizedBox(width: 4),
const Icon(CupertinoIcons.checkmark_seal_fill, color: TeacherTheme.emeraldPrimary, size: 15),
const Icon(CupertinoIcons.checkmark_seal_fill,
color: TeacherTheme.emeraldPrimary, size: 15),
],
),
Text(
'${profile.specialization} · ${profile.gradesTaught.join("، ")}',
style: const TextStyle(fontSize: 10.5, color: Color(0xFF94A3B8)),
style: const TextStyle(
fontSize: 10.5, color: Color(0xFF94A3B8)),
overflow: TextOverflow.ellipsis,
),
],
@@ -294,13 +338,15 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
// Edit Profile Button
IconButton(
tooltip: 'تعديل بيانات المعلم والصفوف',
icon: const Icon(CupertinoIcons.slider_horizontal_3, color: TeacherTheme.emeraldPrimary, size: 20),
icon: const Icon(CupertinoIcons.slider_horizontal_3,
color: TeacherTheme.emeraldPrimary, size: 20),
onPressed: () => _openEditProfileDialog(context, profile),
),
// Logout Button
IconButton(
tooltip: 'تسجيل الخروج',
icon: const Icon(CupertinoIcons.square_arrow_right, color: Color(0xFFFF453A), size: 20),
icon: const Icon(CupertinoIcons.square_arrow_right,
color: Color(0xFFFF453A), size: 20),
onPressed: () => _confirmLogout(context),
),
],
@@ -317,7 +363,8 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
bottomNavigationBar: Container(
decoration: const BoxDecoration(
color: TeacherTheme.surfaceDark,
border: Border(top: BorderSide(color: TeacherTheme.surfaceBorder)),
border:
Border(top: BorderSide(color: TeacherTheme.surfaceBorder)),
),
child: BottomNavigationBar(
currentIndex: _currentTabIndex,
@@ -325,7 +372,8 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
backgroundColor: Colors.transparent,
selectedItemColor: TeacherTheme.emeraldPrimary,
unselectedItemColor: const Color(0xFF64748B),
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.w800, fontSize: 11),
selectedLabelStyle:
const TextStyle(fontWeight: FontWeight.w800, fontSize: 11),
unselectedLabelStyle: const TextStyle(fontSize: 10.5),
type: BottomNavigationBarType.fixed,
elevation: 0,