Update Saqel Platform: 2026-09-12 13:38:49
This commit is contained in:
+86
-27
@@ -7,7 +7,16 @@ import '../../../data/repositories/error_notebook_repository.dart';
|
||||
/// SAQEL ENTERPRISE - SMART ERROR NOTEBOOK & ADAPTIVE REMEDIATION SCREEN
|
||||
/// ==============================================================================
|
||||
class SmartErrorNotebookScreen extends StatefulWidget {
|
||||
const SmartErrorNotebookScreen({super.key});
|
||||
final bool isGuardianMode;
|
||||
final String? studentName;
|
||||
final int? studentId;
|
||||
|
||||
const SmartErrorNotebookScreen({
|
||||
super.key,
|
||||
this.isGuardianMode = false,
|
||||
this.studentName,
|
||||
this.studentId,
|
||||
});
|
||||
|
||||
@override
|
||||
State<SmartErrorNotebookScreen> createState() =>
|
||||
@@ -33,7 +42,9 @@ class _SmartErrorNotebookScreenState extends State<SmartErrorNotebookScreen> {
|
||||
|
||||
Future<void> _loadNotebookData() async {
|
||||
setState(() => _isLoading = true);
|
||||
final data = await _repository.getErrorNotebook();
|
||||
final data = (widget.isGuardianMode && widget.studentId != null)
|
||||
? await _repository.getChildErrorNotebook(widget.studentId!)
|
||||
: await _repository.getErrorNotebook();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_summary = data['summary'] as ErrorNotebookSummary?;
|
||||
@@ -110,19 +121,43 @@ class _SmartErrorNotebookScreenState extends State<SmartErrorNotebookScreen> {
|
||||
icon: const Icon(CupertinoIcons.back, color: Colors.white),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
title: const Row(
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(CupertinoIcons.book_circle_fill,
|
||||
const Icon(CupertinoIcons.book_circle_fill,
|
||||
color: Color(0xFF38BDF8), size: 22),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'دفتر الأخطاء الذكي والمسار العلاجي',
|
||||
style: TextStyle(
|
||||
fontSize: 16.5,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.isGuardianMode
|
||||
? 'دفتر أخطاء الطالب: ${widget.studentName ?? "المسجل"}'
|
||||
: 'دفتر الأخطاء الذكي والمسار العلاجي',
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
if (widget.isGuardianMode) ...[
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF59E0B).withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: const Color(0xFFF59E0B).withOpacity(0.5)),
|
||||
),
|
||||
child: const Text(
|
||||
'رقابة الأهل 👨👧👦',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFFBBF24),
|
||||
fontSize: 10.5,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
@@ -593,22 +628,46 @@ class _SmartErrorNotebookScreenState extends State<SmartErrorNotebookScreen> {
|
||||
|
||||
// Action Button
|
||||
if (!item.isMastered)
|
||||
ElevatedButton.icon(
|
||||
onPressed: () => _startRemediation(item),
|
||||
icon: const Icon(CupertinoIcons.bolt_horizontal_circle_fill, size: 17),
|
||||
label: const Text(
|
||||
'بدء المسار العلاجي لسد هذه الفجوة (3 أسئلة تفريدية) 🚀',
|
||||
style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w800),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF0284C7),
|
||||
foregroundColor: Colors.white,
|
||||
minimumSize: const Size(double.infinity, 42),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
)
|
||||
widget.isGuardianMode
|
||||
? Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0284C7).withOpacity(0.12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: const Color(0xFF0284C7).withOpacity(0.3)),
|
||||
),
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(CupertinoIcons.lock_shield, color: Color(0xFF38BDF8), size: 16),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'مسار علاجي تفريدي ينجزه الطالب في حسابه لسد الفجوة 🎯',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFF38BDF8),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ElevatedButton.icon(
|
||||
onPressed: () => _startRemediation(item),
|
||||
icon: const Icon(CupertinoIcons.bolt_horizontal_circle_fill, size: 17),
|
||||
label: const Text(
|
||||
'بدء المسار العلاجي لسد هذه الفجوة (3 أسئلة تفريدية) 🚀',
|
||||
style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w800),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF0284C7),
|
||||
foregroundColor: Colors.white,
|
||||
minimumSize: const Size(double.infinity, 42),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
|
||||
Reference in New Issue
Block a user