feat(ecosystem): full Grade 10 curriculum sync, real device fingerprinting, teacher video dashboard, and official textbook assets
This commit is contained in:
@@ -282,38 +282,134 @@ class _TeacherMonetizationTabState extends State<TeacherMonetizationTab> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPolicyBullet({
|
||||
required IconData icon,
|
||||
required String title,
|
||||
required String desc,
|
||||
}) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.emeraldPrimary.withAlpha(25),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, color: TeacherTheme.emeraldPrimary, size: 16),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.5,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
desc,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF94A3B8),
|
||||
fontSize: 11.5,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<TeacherMonetizationCubit, TeacherMonetizationState>(
|
||||
builder: (context, state) {
|
||||
if (state.financialUnavailable) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 28),
|
||||
child: Center(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(CupertinoIcons.lock_circle_fill,
|
||||
color: TeacherTheme.royalGold, size: 34),
|
||||
const SizedBox(height: 12),
|
||||
const Text('الأرباح والسحب غير متاحين حالياً',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800)),
|
||||
Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.royalGold.withAlpha(35),
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
),
|
||||
child: const Icon(CupertinoIcons.lock_shield_fill,
|
||||
color: TeacherTheme.royalGold, size: 32),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'المحفظة المالية قيد التفعيل المؤسسي 🔒',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.5,
|
||||
fontWeight: FontWeight.w800),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(state.financialMessage,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF94A3B8), fontSize: 13)),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF59E0B).withAlpha(25),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: const Color(0xFFF59E0B).withAlpha(70)),
|
||||
),
|
||||
child: const Text(
|
||||
'سياسة كليك (CliQ) والربط البنكي قيد الاعتماد الرسمي',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFFBBF24),
|
||||
fontSize: 11.5,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Text(
|
||||
state.financialMessage.isNotEmpty
|
||||
? state.financialMessage
|
||||
: 'الأرباح والسحب المالي متوقفان بانتظار اعتماد سياسة السحب البنكي وربط دفتر الاستحقاق القائم على دقائق المشاهدة المعتمدة.',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF94A3B8), fontSize: 13, height: 1.55),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const Divider(color: TeacherTheme.surfaceBorder, height: 1),
|
||||
const SizedBox(height: 16),
|
||||
_buildPolicyBullet(
|
||||
icon: CupertinoIcons.timer,
|
||||
title: 'نموذج الدخل المعتمد',
|
||||
desc: 'يتم احتساب الأرباح وفق دقائق المشاهدة الفعلية للطلبة المؤهلين على الخادم.',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
_buildPolicyBullet(
|
||||
icon: CupertinoIcons.percent,
|
||||
title: 'تقاسم العوائد الثلاثي',
|
||||
desc: '55% حصة المعلم، 15% دعم البيئة التعليمية، و30% تشغيل البنية التحتية.',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
_buildPolicyBullet(
|
||||
icon: CupertinoIcons.bolt_fill,
|
||||
title: 'طريقة الصرف المالي',
|
||||
desc: 'سحب فوري ومباشر إلى حسابك البنكي عبر معرّف كليك فور تفعيل الربط.',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../core/theme/teacher_theme.dart';
|
||||
import '../../../data/repositories/teacher_repository.dart';
|
||||
|
||||
/**
|
||||
* ==============================================================================
|
||||
* SAQEL TEACHER STUDIO - TAB: MY LESSONS & VIDEOS (حصصي وفيديوهاتي)
|
||||
* ==============================================================================
|
||||
*
|
||||
* استعراض الحصص المرفوعة ونسخ الفيديو وحالات المراجعة والاعتماد:
|
||||
* - فحص حالات الاعتماد: معتمد ومنشور، قيد المراجعة، مسودة، أو مستبدل
|
||||
* - أرقام النسخ (v1, v2) وتواريخ النشر والتحديث
|
||||
* - الربط مع شجرة المنهاج الوزاري المعتمد
|
||||
*/
|
||||
class TeacherSubmissionsTab extends StatefulWidget {
|
||||
final VoidCallback? onNavigateToUpload;
|
||||
const TeacherSubmissionsTab({super.key, this.onNavigateToUpload});
|
||||
|
||||
@override
|
||||
State<TeacherSubmissionsTab> createState() => _TeacherSubmissionsTabState();
|
||||
}
|
||||
|
||||
class _TeacherSubmissionsTabState extends State<TeacherSubmissionsTab> {
|
||||
final TeacherRepository _repository = TeacherRepository();
|
||||
bool _isLoading = true;
|
||||
List<Map<String, dynamic>> _submissions = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadSubmissions();
|
||||
}
|
||||
|
||||
Future<void> _loadSubmissions() async {
|
||||
setState(() => _isLoading = true);
|
||||
try {
|
||||
final data = await _repository.getMySubmissions();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_submissions = data;
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
} catch (_) {
|
||||
if (mounted) {
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Color _statusColor(String status) {
|
||||
switch (status.toLowerCase()) {
|
||||
case 'published':
|
||||
case 'approved':
|
||||
return TeacherTheme.emeraldPrimary;
|
||||
case 'review':
|
||||
case 'uploading':
|
||||
return const Color(0xFFF59E0B);
|
||||
case 'rejected':
|
||||
return const Color(0xFFEF4444);
|
||||
case 'superseded':
|
||||
case 'withdrawn':
|
||||
return const Color(0xFF64748B);
|
||||
default:
|
||||
return const Color(0xFF94A3B8);
|
||||
}
|
||||
}
|
||||
|
||||
String _statusLabel(String status) {
|
||||
switch (status.toLowerCase()) {
|
||||
case 'published':
|
||||
return 'منشور ومعتمد في المنهاج 🌟';
|
||||
case 'approved':
|
||||
return 'معتمد ومؤهل للنشر ✅';
|
||||
case 'review':
|
||||
return 'قيد الفحص والتدقيق الأكاديمي ⏳';
|
||||
case 'uploading':
|
||||
return 'جاري معالجة الفيديو ⚙️';
|
||||
case 'rejected':
|
||||
return 'مرفوض — يحتاج تعديل ⚠️';
|
||||
case 'superseded':
|
||||
return 'مستبدل بنسخة أحدث 🔄';
|
||||
case 'withdrawn':
|
||||
return 'مسحوب من النشر 🛑';
|
||||
default:
|
||||
return 'مسودة قيد الإعداد 📝';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_isLoading) {
|
||||
return const Center(
|
||||
child: CupertinoActivityIndicator(color: TeacherTheme.emeraldPrimary, radius: 14),
|
||||
);
|
||||
}
|
||||
|
||||
if (_submissions.isEmpty) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 72,
|
||||
height: 72,
|
||||
decoration: BoxDecoration(
|
||||
color: TeacherTheme.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
border: Border.all(color: TeacherTheme.surfaceBorder),
|
||||
),
|
||||
child: const Icon(CupertinoIcons.videocam_fill,
|
||||
color: TeacherTheme.emeraldPrimary, size: 36),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
const Text(
|
||||
'لا توجد حصص مرفوعة بعد',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 17, fontWeight: FontWeight.w800),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'لم تقم برفع أي فيديوهات أو حصص لمنهاج الصف العاشر بعد. ابدأ برفع أول حصة لتخضع للفحص وتُنشر للطلبة.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Color(0xFF94A3B8), fontSize: 13, height: 1.5),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ElevatedButton.icon(
|
||||
onPressed: widget.onNavigateToUpload,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: TeacherTheme.emeraldPrimary,
|
||||
foregroundColor: Colors.black,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
icon: const Icon(CupertinoIcons.cloud_upload_fill, size: 18),
|
||||
label: const Text('الانتقال لاستوديو الرفع 🎥',
|
||||
style: TextStyle(fontWeight: FontWeight.w800)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return RefreshIndicator(
|
||||
color: TeacherTheme.emeraldPrimary,
|
||||
backgroundColor: TeacherTheme.surfaceDark,
|
||||
onRefresh: _loadSubmissions,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: _submissions.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'إجمالي الحصص المرفوعة (${_submissions.length}) 📚',
|
||||
style: const TextStyle(
|
||||
color: Colors.white, fontSize: 15, fontWeight: FontWeight.w800),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(CupertinoIcons.arrow_clockwise,
|
||||
color: TeacherTheme.emeraldPrimary, size: 18),
|
||||
onPressed: _loadSubmissions,
|
||||
tooltip: 'تحديث القائمة',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final sub = _submissions[index - 1];
|
||||
final versions = (sub['versions'] as List?) ?? [];
|
||||
final subStatus = sub['submission_status']?.toString() ?? 'draft';
|
||||
final color = _statusColor(subStatus);
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 14),
|
||||
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: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
sub['lesson_title']?.toString() ?? 'حصة تعليمية',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w800),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withAlpha(38),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: color.withAlpha(102)),
|
||||
),
|
||||
child: Text(
|
||||
_statusLabel(subStatus),
|
||||
style: TextStyle(
|
||||
color: color, fontSize: 11.5, fontWeight: FontWeight.w800),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(CupertinoIcons.book, color: Color(0xFF64748B), size: 14),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'المبحث: ${sub['subject_key'] ?? "منهاج معتمد"} • ${sub['grade_level'] ?? "الصف العاشر"}',
|
||||
style: const TextStyle(color: Color(0xFF94A3B8), fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (versions.isNotEmpty) ...[
|
||||
const SizedBox(height: 12),
|
||||
const Divider(color: TeacherTheme.surfaceBorder, height: 1),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'النسخ المرفوعة وتاريخ الإيداع:',
|
||||
style: TextStyle(
|
||||
color: Colors.white70, fontSize: 11.5, fontWeight: FontWeight.w700),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
...versions.map((v) {
|
||||
final vNum = v['version_number'] ?? 1;
|
||||
final vStat = v['video_status']?.toString() ?? 'draft';
|
||||
final isCurrent = v['is_current_published'] == true;
|
||||
final vColor = _statusColor(vStat);
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 6),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0F172A),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: isCurrent
|
||||
? TeacherTheme.emeraldPrimary.withAlpha(77)
|
||||
: Colors.white10),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
isCurrent
|
||||
? CupertinoIcons.checkmark_seal_fill
|
||||
: CupertinoIcons.film,
|
||||
color: isCurrent
|
||||
? TeacherTheme.emeraldPrimary
|
||||
: const Color(0xFF94A3B8),
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'النسخة $vNum ${isCurrent ? " (المعتمدة حالياً)" : ""}',
|
||||
style: TextStyle(
|
||||
color: isCurrent ? Colors.white : const Color(0xFFCBD5E1),
|
||||
fontSize: 12,
|
||||
fontWeight: isCurrent ? FontWeight.w800 : FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
_statusLabel(vStat),
|
||||
style: TextStyle(
|
||||
color: vColor, fontSize: 11, fontWeight: FontWeight.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import '../../core/utils/saqel_toast.dart';
|
||||
import '../../data/models/teacher_models.dart';
|
||||
import '../../logic/cubits/teacher_auth_cubit.dart';
|
||||
import 'tabs/teacher_studio_upload_tab.dart';
|
||||
import 'tabs/teacher_submissions_tab.dart';
|
||||
import 'tabs/teacher_monetization_tab.dart';
|
||||
import 'tabs/teacher_reputation_scorecard_tab.dart';
|
||||
import 'tabs/teacher_assignments_qna_tab.dart';
|
||||
@@ -353,11 +354,14 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
|
||||
),
|
||||
body: IndexedStack(
|
||||
index: _currentTabIndex,
|
||||
children: const [
|
||||
TeacherStudioUploadTab(),
|
||||
TeacherMonetizationTab(),
|
||||
TeacherReputationScorecardTab(),
|
||||
TeacherAssignmentsQnATab(),
|
||||
children: [
|
||||
const TeacherStudioUploadTab(),
|
||||
TeacherSubmissionsTab(
|
||||
onNavigateToUpload: () => setState(() => _currentTabIndex = 0),
|
||||
),
|
||||
const TeacherMonetizationTab(),
|
||||
const TeacherReputationScorecardTab(),
|
||||
const TeacherAssignmentsQnATab(),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
@@ -379,8 +383,12 @@ class _TeacherMainShellState extends State<TeacherMainShell> {
|
||||
elevation: 0,
|
||||
items: const [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.videocam_circle_fill),
|
||||
label: 'استوديو الحصص',
|
||||
icon: Icon(CupertinoIcons.cloud_upload_fill),
|
||||
label: 'استوديو الرفع',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.play_rectangle_fill),
|
||||
label: 'حصصي وفيديوهاتي',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(CupertinoIcons.money_dollar_circle_fill),
|
||||
|
||||
Reference in New Issue
Block a user