Update Saqel Platform: 2026-09-04 21:26:55
This commit is contained in:
@@ -0,0 +1,329 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../../../core/theme/teacher_theme.dart';
|
||||
import '../../../data/models/teacher_models.dart';
|
||||
import '../../../logic/cubits/teacher_qna_cubit.dart';
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - TAB 4: ASSIGNMENTS & Q&A (VOICE REPLIES)
|
||||
* ==============================================================================
|
||||
*
|
||||
* إدارة الواجبات المدرسية الموجهة وغرفة الشكوك والاستفسارات:
|
||||
* - إسناد أوراق عمل مؤتمتة التصحيح بنقرة واحدة
|
||||
* - تسجيل الردود الصوتية السقراطية (Socratic Voice Replies 🎙️)
|
||||
* - مؤشرات تسليم الطلاب ومعدلات الشعب المدرسية.
|
||||
*/
|
||||
class TeacherAssignmentsQnATab extends StatefulWidget {
|
||||
const TeacherAssignmentsQnATab({super.key});
|
||||
|
||||
@override
|
||||
State<TeacherAssignmentsQnATab> createState() => _TeacherAssignmentsQnATabState();
|
||||
}
|
||||
|
||||
class _TeacherAssignmentsQnATabState extends State<TeacherAssignmentsQnATab> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<TeacherQnACubit>().loadQnA();
|
||||
}
|
||||
|
||||
void _dispatchNewHomework() {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (ctx) => Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: CupertinoAlertDialog(
|
||||
title: const Text('إسناد ورقة عمل تفاعلية جديدة 📝'),
|
||||
content: const Text(
|
||||
'سيقوم محرك صَقِل بتوليد ورقة عمل مكونة من 5 مسائل تدريبية متدرجة من بنك الأسئلة الوزاري وإرسالها فوراً لشعبتك مع التصحيح التلقائي.',
|
||||
),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
onPressed: () => Navigator.of(ctx).pop(),
|
||||
child: const Text('إلغاء'),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
isDefaultAction: true,
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
context.read<TeacherQnACubit>().dispatchNewHomework(
|
||||
title: 'ورقة عمل: الشغل والطاقة الميكانيكية',
|
||||
className: 'الأول ثانوي العلمي (شعبة أ وب)',
|
||||
dueDate: 'الخميس القادم',
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('تم إسناد ورقة العمل وإشعار الطلبة بنجاح 🚀'),
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Text('إسناد للطلبة الآن'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _recordVoiceReply(String doubtId) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (ctx) => Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||
border: Border(top: BorderSide(color: TeacherTheme.emeraldPrimary, width: 2)),
|
||||
),
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(CupertinoIcons.mic_circle_fill, size: 56, color: TeacherTheme.emeraldPrimary),
|
||||
const SizedBox(height: 12),
|
||||
const Text(
|
||||
'تسجيل رد صوتي سقراطي للطالب 🎙️',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w800, color: Colors.white),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const Text(
|
||||
'سيصل التسجيل الصوتي بجودة عالية داخل تطبيق الطالب مع التوجيه المفاهيمي.',
|
||||
style: TextStyle(fontSize: 12, color: Color(0xFF94A3B8)),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
context.read<TeacherQnACubit>().recordVoiceReply(doubtId);
|
||||
Navigator.of(ctx).pop();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('تم إرسال الرد الصوتي للطالب بنجاح 🎧'),
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(CupertinoIcons.paperplane_fill, size: 16),
|
||||
label: const Text('إنهاء وإرسال التسجيل الصوتي (00:42)'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
foregroundColor: Colors.black,
|
||||
minimumSize: const Size(double.infinity, 44),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<TeacherQnACubit, TeacherQnAState>(
|
||||
builder: (context, state) {
|
||||
if (state.isLoading) {
|
||||
return const Center(child: CupertinoActivityIndicator(color: TeacherTheme.emeraldPrimary));
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Top Action Card
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF064E3B), Color(0xFF0F172A)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: TeacherTheme.emeraldPrimary.withOpacity(0.4)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'أوراق العمل والواجبات الوزارية 📝',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w800, color: Colors.white),
|
||||
),
|
||||
SizedBox(height: 3),
|
||||
Text(
|
||||
'تصحيح مؤتمت بنسبة 100% مرتبط ببنك الأسئلة',
|
||||
style: TextStyle(fontSize: 11.5, color: Color(0xFF94A3B8)),
|
||||
),
|
||||
],
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
onPressed: _dispatchNewHomework,
|
||||
icon: const Icon(CupertinoIcons.plus_circle_fill, size: 16),
|
||||
label: const Text('إسناد واجب جديد', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w800)),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
foregroundColor: Colors.black,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Homeworks List
|
||||
...state.homeworks.map((hw) => _buildHomeworkCard(hw)),
|
||||
|
||||
const SizedBox(height: 18),
|
||||
|
||||
// Student Doubts Section
|
||||
const Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.bubble_left_bubble_right_fill, color: TeacherTheme.cyberCyan, size: 18),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'استفسارات وأسئلة الطلبة الميدانية (غرفة الشكوك) 💬',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w800, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
// Doubts List
|
||||
...state.doubts.map((doubt) => _buildDoubtCard(doubt)),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHomeworkCard(TeacherHomeworkModel hw) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(hw.title, style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w800, color: Colors.white)),
|
||||
const SizedBox(height: 4),
|
||||
Text('${hw.className} · ${hw.dueDate}', style: const TextStyle(fontSize: 11, color: Color(0xFF94A3B8))),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.emeraldPrimary.withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
hw.submitted,
|
||||
style: const TextStyle(fontSize: 11, fontWeight: FontWeight.w700, color: TeacherTheme.emeraldLight),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text('معدل الشعبة: ${hw.averageScore}', style: const TextStyle(fontSize: 10.5, color: Color(0xFF64748B))),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDoubtCard(StudentDoubtModel d) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(
|
||||
color: d.replied ? TeacherTheme.emeraldPrimary.withOpacity(0.3) : TeacherTheme.cyberCyan.withOpacity(0.4),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${d.studentName} · ${d.className}',
|
||||
style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w800, color: TeacherTheme.cyberCyan),
|
||||
),
|
||||
Text(d.time, style: const TextStyle(fontSize: 11, color: Color(0xFF64748B))),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
d.question,
|
||||
style: const TextStyle(fontSize: 13, color: Colors.white, height: 1.4),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if (d.replied)
|
||||
const Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.checkmark_seal_fill, color: TeacherTheme.emeraldLight, size: 15),
|
||||
SizedBox(width: 6),
|
||||
Text(
|
||||
'تم إرسال الرد الصوتي للطالب 🎧',
|
||||
style: TextStyle(fontSize: 11.5, color: Color(0xFF6EE7B7), fontWeight: FontWeight.w700),
|
||||
),
|
||||
],
|
||||
)
|
||||
else
|
||||
const Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.clock_fill, color: TeacherTheme.royalGold, size: 14),
|
||||
SizedBox(width: 6),
|
||||
Text(
|
||||
'بانتظار إجابة المعلم',
|
||||
style: TextStyle(fontSize: 11.5, color: TeacherTheme.royalGold),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (!d.replied)
|
||||
ElevatedButton.icon(
|
||||
onPressed: () => _recordVoiceReply(d.id),
|
||||
icon: const Icon(CupertinoIcons.mic_fill, size: 14),
|
||||
label: const Text('تسجيل رد صوتي 🎙️', style: TextStyle(fontSize: 11, fontWeight: FontWeight.w700)),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF0284C7),
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,492 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../../../core/theme/teacher_theme.dart';
|
||||
import '../../../logic/cubits/teacher_monetization_cubit.dart';
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - TAB 2: MONETIZATION & CLIQ PAYOUT
|
||||
* ==============================================================================
|
||||
*
|
||||
* إدارة التسييل المالي وتقاسم العوائد الثلاثي:
|
||||
* - 55% حصة المعلم المباشرة
|
||||
* - 15% حصة مديرية الثقافة العسكرية
|
||||
* - 30% حصة المنصة وتكاليف البنية التحتية
|
||||
* - نموذج التسعير المزدوج: 1,420 طالب مؤسسي مجاناً مقابل 380 طالباً مشتركاً مدفوعاً
|
||||
* - سحب فوري عبر كليك (CliQ Payout Queue).
|
||||
*/
|
||||
class TeacherMonetizationTab extends StatefulWidget {
|
||||
const TeacherMonetizationTab({super.key});
|
||||
|
||||
@override
|
||||
State<TeacherMonetizationTab> createState() => _TeacherMonetizationTabState();
|
||||
}
|
||||
|
||||
class _TeacherMonetizationTabState extends State<TeacherMonetizationTab> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<TeacherMonetizationCubit>().loadMonetization();
|
||||
}
|
||||
|
||||
void _showCliqPayoutDialog(BuildContext ctx, double availableBalance) {
|
||||
final TextEditingController cliqController = TextEditingController(text: 'AHMAD@CLIQ');
|
||||
final TextEditingController amountController = TextEditingController(text: availableBalance.toInt().toString());
|
||||
|
||||
showModalBottomSheet(
|
||||
context: ctx,
|
||||
backgroundColor: TeacherTheme.surfaceCard,
|
||||
isScrollControlled: true,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
builder: (bCtx) => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(bCtx).viewInsets.bottom + 20,
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 24,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.bolt_fill, color: TeacherTheme.emeraldPrimary, size: 22),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'طلب سحب فوري عبر كليك (CliQ)',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w800, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(bCtx),
|
||||
icon: const Icon(CupertinoIcons.xmark_circle_fill, color: Color(0xFF64748B)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const Text(
|
||||
'تتم معالجة الحوالة فورياً وإدراجها في طابور السحب الآلي لحسابك البنكي.',
|
||||
style: TextStyle(fontSize: 12, color: Color(0xFF94A3B8)),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextField(
|
||||
controller: cliqController,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 13),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'معرّف كليك (CliQ Alias) أو رقم الهاتف',
|
||||
labelStyle: const TextStyle(color: Color(0xFF94A3B8), fontSize: 12),
|
||||
filled: true,
|
||||
fillColor: const Color(0xFF1E293B),
|
||||
prefixIcon: const Icon(CupertinoIcons.person_crop_circle, color: TeacherTheme.emeraldPrimary, size: 20),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide.none),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
controller: amountController,
|
||||
keyboardType: TextInputType.number,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 13),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'المبلغ المطلوب سحبه (دينار أردني)',
|
||||
labelStyle: const TextStyle(color: Color(0xFF94A3B8), fontSize: 12),
|
||||
filled: true,
|
||||
fillColor: const Color(0xFF1E293B),
|
||||
prefixIcon: const Icon(CupertinoIcons.money_dollar, color: TeacherTheme.emeraldPrimary, size: 20),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide.none),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
final double? amt = double.tryParse(amountController.text);
|
||||
if (amt != null && amt > 0) {
|
||||
ctx.read<TeacherMonetizationCubit>().submitCliqPayout(
|
||||
cliqAlias: cliqController.text,
|
||||
amountJod: amt,
|
||||
);
|
||||
}
|
||||
Navigator.pop(bCtx);
|
||||
ScaffoldMessenger.of(ctx).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('تم إدراج طلب السحب بمبلغ ${amountController.text} د.أ في طابور كليك بنجاح ⚡'),
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(CupertinoIcons.paperplane_fill, size: 16),
|
||||
label: const Text('تأكيد وإرسال لطابور السحب الفوري (CliQ Queue)'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
foregroundColor: Colors.black,
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<TeacherMonetizationCubit, TeacherMonetizationState>(
|
||||
builder: (context, state) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Dual Pricing Audience Breakdown Card
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تصنيف قاعدة الطلبة (المؤسسي مقابل الخارجي) 👥',
|
||||
style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w800, color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
'تحديث الكشوفات: اليوم',
|
||||
style: TextStyle(fontSize: 11, color: Color(0xFF64748B)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF064E3B).withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: TeacherTheme.emeraldPrimary.withOpacity(0.3)),
|
||||
),
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'طلبة الثقافة العسكرية والمدارس الشريكة',
|
||||
style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w700, color: Colors.white),
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
'مشمولون برسم (0.00 د.أ) ضمن العقد المؤسسي',
|
||||
style: TextStyle(fontSize: 11, color: TeacherTheme.emeraldLight),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'1,420 طالباً 🎖️',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w900, color: TeacherTheme.emeraldLight),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0369A1).withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: const Color(0xFF0284C7).withOpacity(0.3)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'الطلبة المستقلون (سوق صَقِل المفتوح)',
|
||||
style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w700, color: Colors.white),
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
'مشتركون عبر نظام الدفع الفوري كليك (CliQ)',
|
||||
style: TextStyle(fontSize: 11, color: TeacherTheme.cyberCyan),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'${state.studentSubscribers.toInt()} طالباً 💳',
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w900, color: TeacherTheme.cyberCyan),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Wallet Card
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF064E3B), Color(0xFF062E25)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: TeacherTheme.emeraldPrimary.withOpacity(0.4)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: TeacherTheme.emeraldPrimary.withOpacity(0.15),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'الرصيد المتاح للسحب (حصة المعلم 55%):',
|
||||
style: TextStyle(
|
||||
fontSize: 12.5,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFF6EE7B7),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: const Text(
|
||||
'CliQ & IBAN',
|
||||
style: TextStyle(fontSize: 11, color: TeacherTheme.emeraldLight, fontWeight: FontWeight.w700),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'${state.teacherShare.toStringAsFixed(0)} دينار أردني',
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
_showCliqPayoutDialog(context, state.teacherShare);
|
||||
},
|
||||
icon: const Icon(CupertinoIcons.bolt_fill, size: 16),
|
||||
label: const Text(
|
||||
'سحب فوري عبر كليك (CliQ)',
|
||||
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w800),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
foregroundColor: Colors.black,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
OutlinedButton.icon(
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('تم تقديم طلب التحويل لحسابك البنكي IBAN بنجاح.'),
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(CupertinoIcons.building_2_fill, size: 16, color: Colors.white),
|
||||
label: const Text('تحويل بنكي', style: TextStyle(fontSize: 12, color: Colors.white)),
|
||||
style: OutlinedButton.styleFrom(
|
||||
side: BorderSide(color: Colors.white.withOpacity(0.3)),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
|
||||
// Interactive Revenue Share Formula
|
||||
Container(
|
||||
padding: const EdgeInsets.all(18),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'نموذج تقاسم العوائد الثلاثي المعتمد (الفصل السابع):',
|
||||
style: TextStyle(
|
||||
fontSize: 13.5,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
|
||||
// Split Bars
|
||||
_splitRow(
|
||||
'حصة المعلم المباشرة (55%):',
|
||||
'${state.teacherShare.toStringAsFixed(0)} د.أ',
|
||||
TeacherTheme.emeraldPrimary,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_splitRow(
|
||||
'حصة مديرية الثقافة العسكرية (15%):',
|
||||
'${state.directorateShare.toStringAsFixed(0)} د.أ',
|
||||
TeacherTheme.royalGold,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_splitRow(
|
||||
'حصة منصة صَقِل للبنية والسيرفرات (30%):',
|
||||
'${state.platformShare.toStringAsFixed(0)} د.أ',
|
||||
TeacherTheme.cyberCyan,
|
||||
),
|
||||
|
||||
const Divider(color: TeacherTheme.surfaceBorder, height: 24),
|
||||
|
||||
// Subscribers Slider
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'محاكي المشتركين خارج الثقافة:',
|
||||
style: TextStyle(fontSize: 12, color: Color(0xFF94A3B8)),
|
||||
),
|
||||
Text(
|
||||
'${state.studentSubscribers.toInt()} طالب مشترك',
|
||||
style: const TextStyle(fontSize: 13.5, fontWeight: FontWeight.w800, color: TeacherTheme.emeraldLight),
|
||||
),
|
||||
],
|
||||
),
|
||||
Slider(
|
||||
value: state.studentSubscribers,
|
||||
min: 50,
|
||||
max: 2000,
|
||||
divisions: 39,
|
||||
activeColor: TeacherTheme.emeraldPrimary,
|
||||
inactiveColor: TeacherTheme.surfaceBorder,
|
||||
onChanged: (val) {
|
||||
context.read<TeacherMonetizationCubit>().updateSubscribers(val);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
|
||||
// Active Courses Selling
|
||||
const Text(
|
||||
'الدورات المنشورة في سوق صَقِل الخارجي:',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w800, color: Colors.white),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
_courseEarningCard(
|
||||
title: 'الفيزياء للتوجيهي العلمي (الفصل الأول)',
|
||||
students: 240,
|
||||
revenue: '2,640 د.أ',
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_courseEarningCard(
|
||||
title: 'المكثف الشامل لقوانين نيوتن وحفظ الطاقة',
|
||||
students: 140,
|
||||
revenue: '1,540 د.أ',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _splitRow(String label, String amount, Color color) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(width: 8, height: 8, decoration: BoxDecoration(color: color, shape: BoxShape.circle)),
|
||||
const SizedBox(width: 8),
|
||||
Text(label, style: const TextStyle(fontSize: 12.5, color: Colors.white)),
|
||||
],
|
||||
),
|
||||
Text(amount, style: TextStyle(fontSize: 13.5, fontWeight: FontWeight.w900, color: color)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _courseEarningCard({
|
||||
required String title,
|
||||
required int students,
|
||||
required String revenue,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(title, style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w800, color: Colors.white)),
|
||||
const SizedBox(height: 3),
|
||||
Text('$students طالب مشترك · رسوم 20 د.أ', style: const TextStyle(fontSize: 11, color: Color(0xFF94A3B8))),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(revenue, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w900, color: TeacherTheme.emeraldPrimary)),
|
||||
const Text('صافي أرباحك', style: TextStyle(fontSize: 10, color: Color(0xFF64748B))),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../core/theme/teacher_theme.dart';
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - TAB 3: REPUTATION & CERTIFICATION SCORECARD
|
||||
* ==============================================================================
|
||||
*
|
||||
* بطاقة تقييم الأداء والاعتماد الأكاديمي للمعلم:
|
||||
* - وسام المعلم المعتمد رسمياً فوق 90% (Saqel Certified Teacher)
|
||||
* - رادار الجودة التربوية (نتاجات المنهاج، الفواصل السقراطية، السلامة اللغوية، والتركيز 20-25 دقيقة)
|
||||
* - توجيهات الذكاء الاصطناعي الأسبوعية للتحسين المستمر.
|
||||
*/
|
||||
class TeacherReputationScorecardTab extends StatelessWidget {
|
||||
const TeacherReputationScorecardTab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Top Merit Card
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF1E1B4B), Color(0xFF0F172A)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: const Color(0xFF8B5CF6).withOpacity(0.5)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
radius: 32,
|
||||
backgroundColor: Color(0xFF8B5CF6),
|
||||
child: Icon(CupertinoIcons.rosette, size: 36, color: Colors.white),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const Text(
|
||||
'أ. أحمد المجالي',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.emeraldPrimary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: const Text(
|
||||
'🏅 معلم معتمد رسمياً من منصة صَقِل (فوق 90%)',
|
||||
style: TextStyle(
|
||||
fontSize: 11.5,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: TeacherTheme.emeraldLight,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
_ScoreStat(label: 'التقييم العام', value: '4.92 / 5.0'),
|
||||
_ScoreStat(label: 'الطلاب المخدومون', value: '1,240 طالب'),
|
||||
_ScoreStat(label: 'نسبة النجاح', value: '98.2%'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
|
||||
// Pedagogical Metrics Breakdown
|
||||
Container(
|
||||
padding: const EdgeInsets.all(18),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'رادار الجودة التربوية المعتمد:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
_metricProgress('الالتزام بالمنهاج والنتاجات الوزارية', 0.96, TeacherTheme.emeraldPrimary),
|
||||
const SizedBox(height: 12),
|
||||
_metricProgress('التفاعل السقراطي وإثارة التفكير', 0.89, TeacherTheme.cyberCyan),
|
||||
const SizedBox(height: 12),
|
||||
_metricProgress('الوضوح الصوتي وسلامة اللغة', 0.94, TeacherTheme.royalGold),
|
||||
const SizedBox(height: 12),
|
||||
_metricProgress('إدارة الوقت والتركيز الإدراكي (20-25 دقيقة)', 0.92, const Color(0xFF8B5CF6)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
|
||||
// AI Growth Insights Box
|
||||
Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF1E293B),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(color: const Color(0xFF334155)),
|
||||
),
|
||||
child: const Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(CupertinoIcons.lightbulb_fill, color: TeacherTheme.royalGold, size: 20),
|
||||
SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'توجيه الذكاء الاصطناعي الأسبوعي: نسبة الالتزام الوزاري ممتازة (96%). يُوصى بإضافة وقفة سقراطية استنتاجية في الدقيقة 14 من الدرس القادم لتعزيز تفاعل الطلبة.',
|
||||
style: TextStyle(fontSize: 12, color: Color(0xFFCBD5E1), height: 1.4),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _metricProgress(String title, double value, Color color) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(title, style: const TextStyle(fontSize: 12, color: Colors.white)),
|
||||
Text('${(value * 100).toInt()}%', style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w800, color: color)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: LinearProgressIndicator(
|
||||
value: value,
|
||||
minHeight: 6,
|
||||
backgroundColor: const Color(0xFF1E293B),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(color),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ScoreStat extends StatelessWidget {
|
||||
final String label;
|
||||
final String value;
|
||||
|
||||
const _ScoreStat({required this.label, required this.value});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Text(value, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w900, color: Colors.white)),
|
||||
const SizedBox(height: 2),
|
||||
Text(label, style: const TextStyle(fontSize: 11, color: Color(0xFF94A3B8))),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../../../core/theme/teacher_theme.dart';
|
||||
import '../../../data/models/teacher_models.dart';
|
||||
import '../../../logic/cubits/teacher_studio_cubit.dart';
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - TAB 1: LESSON UPLOAD & QUALITY GATE
|
||||
* ==============================================================================
|
||||
*
|
||||
* بوابة جودة الحصص واستوديو الرفع:
|
||||
* - التحقق الإدراكي من معيار معهد ماساتشوستس للتركيز الذهني (20-25 دقيقة)
|
||||
* - فحص نتاجات المنهاج، نقاء الصوت، والمحطات السقراطية الذكية
|
||||
* - زر الاعتماد والنشر المشفر في سوق التسييل.
|
||||
*/
|
||||
class TeacherStudioUploadTab extends StatefulWidget {
|
||||
const TeacherStudioUploadTab({super.key});
|
||||
|
||||
@override
|
||||
State<TeacherStudioUploadTab> createState() => _TeacherStudioUploadTabState();
|
||||
}
|
||||
|
||||
class _TeacherStudioUploadTabState extends State<TeacherStudioUploadTab> {
|
||||
late final TextEditingController _titleController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_titleController = TextEditingController(
|
||||
text: context.read<TeacherStudioCubit>().state.lessonTitle,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_titleController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<TeacherStudioCubit, TeacherStudioState>(
|
||||
builder: (context, state) {
|
||||
final bool isDurationGood = state.durationMinutes >= 15.0 && state.durationMinutes <= 25.0;
|
||||
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Banner
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF064E3B), Color(0xFF0F172A)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: TeacherTheme.emeraldPrimary.withOpacity(0.4)),
|
||||
),
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.sparkles, color: TeacherTheme.emeraldLight, size: 20),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'بوابة جودة حصص الأستوديو الرقمية (صَقِل 2.0)',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 6),
|
||||
Text(
|
||||
'تخضع كل حصة رقمية لمعايير التركيز الإدراكي (20-25 دقيقة كحد أقصى) وفحص الذكاء الاصطناعي بنسبة قبول لا تقل عن 85% قبل نشرها وتسييلها.',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Color(0xFF94A3B8),
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Upload Details Card
|
||||
Container(
|
||||
padding: const EdgeInsets.all(18),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'عنوان الحصة الصفية الرقمية:',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextField(
|
||||
controller: _titleController,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 13.5),
|
||||
onChanged: (val) => context.read<TeacherStudioCubit>().updateLessonTitle(val),
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: const Color(0xFF161F30),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Color(0xFF334155)),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Duration Slider
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'مدة الشرح الرقمي:',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: isDurationGood
|
||||
? TeacherTheme.emeraldPrimary.withOpacity(0.2)
|
||||
: TeacherTheme.crimsonRed.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
'${state.durationMinutes.toStringAsFixed(1)} دقيقة',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: isDurationGood ? TeacherTheme.emeraldLight : TeacherTheme.crimsonRed,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Slider(
|
||||
value: state.durationMinutes,
|
||||
min: 5.0,
|
||||
max: 45.0,
|
||||
divisions: 40,
|
||||
activeColor: isDurationGood ? TeacherTheme.emeraldPrimary : TeacherTheme.crimsonRed,
|
||||
inactiveColor: TeacherTheme.surfaceBorder,
|
||||
onChanged: (val) {
|
||||
context.read<TeacherStudioCubit>().updateDuration(val);
|
||||
},
|
||||
),
|
||||
|
||||
// Cognitive Indicator Message
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: isDurationGood
|
||||
? const Color(0xFF064E3B).withOpacity(0.2)
|
||||
: const Color(0xFF7F1D1D).withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: isDurationGood
|
||||
? TeacherTheme.emeraldPrimary.withOpacity(0.4)
|
||||
: TeacherTheme.crimsonRed.withOpacity(0.4),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
isDurationGood
|
||||
? CupertinoIcons.check_mark_circled_solid
|
||||
: CupertinoIcons.exclamationmark_triangle_fill,
|
||||
size: 18,
|
||||
color: isDurationGood ? TeacherTheme.emeraldLight : TeacherTheme.crimsonRed,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
isDurationGood
|
||||
? 'مثالي: الشرح ضمن المدى الإدراكي القياسي (20 إلى 25 دقيقة) لمعادلة تركيز الحصة الصفية.'
|
||||
: 'تحذير إدراكي: الشرح يتجاوز 25 دقيقة! ينخفض الاستيعاب بعد الدقيقة 18، يرجى اختصار المقطع أو تقسيمه.',
|
||||
style: TextStyle(
|
||||
fontSize: 11.5,
|
||||
color: isDurationGood ? const Color(0xFF6EE7B7) : const Color(0xFFFCA5A5),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
|
||||
// Run Audit Button
|
||||
ElevatedButton.icon(
|
||||
onPressed: state.isAuditing
|
||||
? null
|
||||
: () {
|
||||
context.read<TeacherStudioCubit>().runQualityGate();
|
||||
},
|
||||
icon: state.isAuditing
|
||||
? const SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.black),
|
||||
)
|
||||
: const Icon(CupertinoIcons.checkmark_shield_fill, size: 18),
|
||||
label: Text(
|
||||
state.isAuditing
|
||||
? 'جاري التدقيق التربوي عبر محرك صَقِل...'
|
||||
: 'فحص الحصة عبر بوابة الجودة الذكية (عتبة 85%) ⚡',
|
||||
style: const TextStyle(fontSize: 13.5, fontWeight: FontWeight.w800),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
foregroundColor: Colors.black,
|
||||
minimumSize: const Size(double.infinity, 44),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Quality Audit Result Card
|
||||
if (state.auditResult != null) _buildAuditResultCard(context, state.auditResult!),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAuditResultCard(BuildContext context, TeacherLessonAuditModel res) {
|
||||
final int score = res.qualityScore;
|
||||
final bool isApproved = score >= 85;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(18),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(
|
||||
color: isApproved ? TeacherTheme.emeraldPrimary : TeacherTheme.crimsonRed,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
isApproved ? CupertinoIcons.checkmark_seal_fill : CupertinoIcons.xmark_seal_fill,
|
||||
color: isApproved ? TeacherTheme.emeraldPrimary : TeacherTheme.crimsonRed,
|
||||
size: 22,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
isApproved ? 'حصة معتمدة للبث والتسييل 🏅' : 'تجميد الحصة للمراجعة ⚠️',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: isApproved ? TeacherTheme.emeraldPrimary : TeacherTheme.crimsonRed,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: isApproved
|
||||
? TeacherTheme.emeraldPrimary.withOpacity(0.2)
|
||||
: TeacherTheme.crimsonRed.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
'درجة التقييم: $score%',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: isApproved ? TeacherTheme.emeraldLight : TeacherTheme.crimsonRed,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
res.decision,
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Colors.white,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
const Divider(color: TeacherTheme.surfaceBorder, height: 20),
|
||||
|
||||
// Breakdown
|
||||
_rowMetric('التطابق مع نتاجات المنهاج:', res.curriculumAlignment),
|
||||
const SizedBox(height: 6),
|
||||
_rowMetric('نقاء الصوت ومخارج الحروف:', res.audioClarity),
|
||||
const SizedBox(height: 6),
|
||||
_rowMetric('الفواصل السقراطية التفاعلية:', '${res.socraticStopsCount} محطات تفكيرية إلزامية'),
|
||||
const SizedBox(height: 14),
|
||||
|
||||
if (isApproved)
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('تم ترحيل الحصة لتقطيع البث المشفر ونشرها في سوق صَقِل! 🚀'),
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(CupertinoIcons.cloud_upload_fill, size: 16),
|
||||
label: const Text('نشر الحصة في سوق التسييل التجاري 💰'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldDark,
|
||||
foregroundColor: Colors.white,
|
||||
minimumSize: const Size(double.infinity, 42),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _rowMetric(String label, dynamic value) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(label, style: const TextStyle(fontSize: 12, color: Color(0xFF94A3B8))),
|
||||
Text('$value', style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w700, color: Color(0xFFCBD5E1))),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../core/theme/teacher_theme.dart';
|
||||
import 'tabs/teacher_studio_upload_tab.dart';
|
||||
import 'tabs/teacher_monetization_tab.dart';
|
||||
import 'tabs/teacher_reputation_scorecard_tab.dart';
|
||||
import 'tabs/teacher_assignments_qna_tab.dart';
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - MAIN SHELL
|
||||
* ==============================================================================
|
||||
*
|
||||
* الهيكل التنفيذي الرئيسي لاستوديو المعلم المعتمد:
|
||||
* - شريط علوي يحمل هوية المعلم، المدرسة، ودرجة الاعتماد الأكاديمي (94%)
|
||||
* - تنقل سفلي مرن بين استوديو الرفع، محفظة التسييل، رادار الأداء، وغرفة الأسئلة.
|
||||
*/
|
||||
class TeacherMainShell extends StatefulWidget {
|
||||
const TeacherMainShell({super.key});
|
||||
|
||||
@override
|
||||
State<TeacherMainShell> createState() => _TeacherMainShellState();
|
||||
}
|
||||
|
||||
class _TeacherMainShellState extends State<TeacherMainShell> {
|
||||
int _currentTabIndex = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: Scaffold(
|
||||
backgroundColor: TeacherTheme.backgroundDark,
|
||||
appBar: AppBar(
|
||||
backgroundColor: TeacherTheme.surfaceDark,
|
||||
elevation: 0,
|
||||
title: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [TeacherTheme.emeraldPrimary, TeacherTheme.emeraldDark],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'م',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'استوديو المعلم المعتمد',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 6),
|
||||
Icon(CupertinoIcons.checkmark_seal_fill, color: TeacherTheme.emeraldPrimary, size: 16),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'أ. أحمد المجالي · فيزياء التوجيهي (الثقافة العسكرية)',
|
||||
style: TextStyle(fontSize: 11, color: Color(0xFF94A3B8)),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.emeraldPrimary.withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: TeacherTheme.emeraldPrimary.withOpacity(0.4)),
|
||||
),
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.star_fill, color: TeacherTheme.royalGold, size: 14),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'معتمد 94%',
|
||||
style: TextStyle(
|
||||
fontSize: 11.5,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: TeacherTheme.emeraldLight,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: IndexedStack(
|
||||
index: _currentTabIndex,
|
||||
children: const [
|
||||
TeacherStudioUploadTab(),
|
||||
TeacherMonetizationTab(),
|
||||
TeacherReputationScorecardTab(),
|
||||
TeacherAssignmentsQnATab(),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: TeacherTheme.surfaceDark,
|
||||
border: Border(top: BorderSide(color: TeacherTheme.surfaceBorder)),
|
||||
),
|
||||
child: BottomNavigationBar(
|
||||
currentIndex: _currentTabIndex,
|
||||
onTap: (idx) => setState(() => _currentTabIndex = idx),
|
||||
backgroundColor: Colors.transparent,
|
||||
selectedItemColor: TeacherTheme.emeraldPrimary,
|
||||
unselectedItemColor: const Color(0xFF64748B),
|
||||
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.w800, fontSize: 11),
|
||||
unselectedLabelStyle: const TextStyle(fontSize: 10.5),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
elevation: 0,
|
||||
items: const [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.videocam_circle_fill),
|
||||
label: 'استوديو الحصص',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.money_dollar_circle_fill),
|
||||
label: 'محفظة التسييل',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.chart_bar_circle_fill),
|
||||
label: 'رادار الأداء',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.chat_bubble_2_fill),
|
||||
label: 'الواجبات والأسئلة',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user