refactor: إعادة تسمية التطبيقات الأربعة siro_* → intaleq_*

المجلدات وأسماء حزم dart واستيراداتها:
  siro_rider → intaleq_rider    siro_driver  → intaleq_driver
  siro_admin → intaleq_admin    siro_service → intaleq_service

شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات
(115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في
backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت).

+ ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت
مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت
تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع
تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة.

⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER ·
shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها
كوميت منفصل، والهويات تحتاج قرار المالك.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hamza-Ayed
2026-07-27 16:10:58 +03:00
co-authored by Claude Opus 5
parent 92dc6b3641
commit 0aab85c732
3137 changed files with 65294 additions and 1950 deletions
@@ -0,0 +1,340 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controller/admin/quality_controller.dart';
class BlacklistPage extends StatelessWidget {
const BlacklistPage({super.key});
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
Get.put(QualityController()).fetchBlacklist();
return Scaffold(
backgroundColor: cs.surface,
body: Column(
children: [
_buildAppBar(context, cs),
_buildTabBar(context, cs),
Expanded(
child: GetBuilder<QualityController>(
builder: (controller) {
if (controller.isLoading) {
return _buildLoadingState(cs);
}
return TabBarView(
controller: DefaultTabController.of(context),
children: [
_buildDriverList(controller, cs),
_buildPassengerList(controller, cs),
],
);
},
),
),
],
),
);
}
Widget _buildAppBar(BuildContext context, ColorScheme cs) {
return Container(
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
decoration: BoxDecoration(
color: cs.surface,
border: Border(bottom: BorderSide(color: cs.outline)),
),
child: Row(
children: [
GestureDetector(
onTap: () => Get.back(),
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.outline),
),
child: Icon(Icons.arrow_back_ios_new_rounded,
color: cs.onSurfaceVariant, size: 16),
),
),
const SizedBox(width: 12),
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: cs.error.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.error.withValues(alpha: 0.25)),
),
child: Icon(Icons.block_rounded, color: cs.error, size: 18),
),
const SizedBox(width: 10),
Text(
'القائمة السوداء',
style: TextStyle(
color: cs.onSurface,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
],
),
);
}
Widget _buildTabBar(BuildContext context, ColorScheme cs) {
return Container(
margin: const EdgeInsets.fromLTRB(16, 12, 16, 0),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: cs.outline),
),
child: TabBar(
controller: DefaultTabController.of(context),
indicator: BoxDecoration(
color: cs.primary.withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.primary.withValues(alpha: 0.3)),
),
indicatorSize: TabBarIndicatorSize.tab,
dividerColor: Colors.transparent,
labelColor: cs.primary,
unselectedLabelColor: cs.onSurfaceVariant,
labelStyle: const TextStyle(fontWeight: FontWeight.w700, fontSize: 13),
unselectedLabelStyle: const TextStyle(fontWeight: FontWeight.w500, fontSize: 13),
padding: const EdgeInsets.all(4),
labelPadding: EdgeInsets.zero,
tabs: const [
Tab(text: 'السائقين', icon: Icon(Icons.drive_eta_rounded, size: 16)),
Tab(text: 'الركاب', icon: Icon(Icons.person_rounded, size: 16)),
],
),
);
}
Widget _buildLoadingState(ColorScheme cs) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 40,
height: 40,
child: CircularProgressIndicator(
color: cs.primary,
strokeWidth: 2,
backgroundColor: cs.primary.withValues(alpha: 0.1),
),
),
const SizedBox(height: 16),
Text('جاري التحميل...',
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 13)),
],
),
);
}
Widget _buildDriverList(QualityController controller, ColorScheme cs) {
if (controller.driversBlacklist.isEmpty) {
return _buildEmptyState('لا يوجد سائقين محظورين', cs);
}
return ListView.builder(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 80),
physics: const BouncingScrollPhysics(),
itemCount: controller.driversBlacklist.length,
itemBuilder: (context, index) {
var driver = controller.driversBlacklist[index];
final String phone = (driver['phone'] ?? driver['phone_normalized'] ?? driver['mobile'] ?? driver['number'] ?? '').toString();
final String reason = (driver['reason'] ?? driver['block_reason'] ?? driver['note'] ?? 'غير محدد').toString();
final String date = (driver['created_at'] ?? driver['createdAt'] ?? driver['date'] ?? driver['blocked_at'] ?? '').toString();
return _buildBlacklistItem(
phone: phone,
reason: reason,
date: date,
type: 'سائق',
icon: Icons.drive_eta_rounded,
onUnblock: () => controller.unblockDriver(phone),
cs: cs,
);
},
);
}
Widget _buildPassengerList(QualityController controller, ColorScheme cs) {
if (controller.passengersBlacklist.isEmpty) {
return _buildEmptyState('لا يوجد ركاب محظورين', cs);
}
return ListView.builder(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 80),
physics: const BouncingScrollPhysics(),
itemCount: controller.passengersBlacklist.length,
itemBuilder: (context, index) {
var passenger = controller.passengersBlacklist[index];
final String phone = (passenger['phone'] ?? passenger['phone_normalized'] ?? passenger['mobile'] ?? passenger['number'] ?? '').toString();
final String reason = (passenger['reason'] ?? passenger['block_reason'] ?? passenger['note'] ?? 'غير محدد').toString();
final String date = (passenger['created_at'] ?? passenger['createdAt'] ?? passenger['date'] ?? passenger['blocked_at'] ?? '').toString();
final String phoneForUnblock = (passenger['phone_normalized'] ?? passenger['phone'] ?? passenger['mobile'] ?? passenger['number'] ?? '').toString();
return _buildBlacklistItem(
phone: phone,
reason: reason,
date: date,
type: 'راكب',
icon: Icons.person_rounded,
onUnblock: () => controller.unblockPassenger(phoneForUnblock),
cs: cs,
);
},
);
}
Widget _buildEmptyState(String message, ColorScheme cs) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
shape: BoxShape.circle,
),
child: Icon(Icons.block_rounded, size: 48, color: cs.onSurfaceVariant),
),
const SizedBox(height: 16),
Text(message,
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 14)),
],
),
);
}
Widget _buildBlacklistItem({
required String phone,
required String reason,
required String date,
required String type,
required IconData icon,
required VoidCallback onUnblock,
required ColorScheme cs,
}) {
return Container(
margin: const EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: cs.error.withValues(alpha: 0.15)),
),
child: Padding(
padding: const EdgeInsets.all(14),
child: Row(
children: [
Container(
width: 44,
height: 44,
decoration: BoxDecoration(
color: cs.error.withValues(alpha: 0.12),
shape: BoxShape.circle,
border: Border.all(color: cs.error.withValues(alpha: 0.2)),
),
child: Icon(icon, color: cs.error, size: 22),
),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
phone,
style: TextStyle(
color: cs.onSurface,
fontWeight: FontWeight.w700,
fontSize: 15,
fontFamily: 'monospace',
),
),
const SizedBox(height: 4),
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: cs.error.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
type,
style: TextStyle(
color: cs.error,
fontSize: 10,
fontWeight: FontWeight.w700,
),
),
),
const SizedBox(width: 6),
Expanded(
child: Text(
'السبب: $reason',
style: TextStyle(
color: cs.onSurfaceVariant,
fontSize: 11,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 3),
Text(
date,
style: TextStyle(
color: cs.onSurfaceVariant,
fontSize: 10,
),
),
],
),
),
const SizedBox(width: 8),
GestureDetector(
onTap: () => _showUnblockDialog(Get.context!, type, phone, onUnblock, cs),
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: const Color(0xFF10B981).withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(10),
border: Border.all(color: const Color(0xFF10B981).withValues(alpha: 0.2)),
),
child: Icon(Icons.settings_backup_restore_rounded,
color: const Color(0xFF10B981), size: 18),
),
),
],
),
),
);
}
void _showUnblockDialog(
BuildContext context, String type, String identifier, VoidCallback onConfirm, ColorScheme cs) {
Get.defaultDialog(
title: "تأكيد فك الحظر",
titleStyle: TextStyle(color: cs.onSurface, fontWeight: FontWeight.bold),
backgroundColor: cs.surface,
middleText:
"هل أنت متأكد من فك الحظر عن هذا ال$type ($identifier)؟\nسيتم تسجيل هذه العملية في الـ Audit Log.",
textConfirm: "نعم، فك الحظر",
textCancel: "تراجع",
confirmTextColor: Colors.white,
buttonColor: const Color(0xFF10B981),
cancelTextColor: cs.onSurfaceVariant,
onConfirm: () {
Get.back();
onConfirm();
},
);
}
}
@@ -0,0 +1,240 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controller/admin/quality_controller.dart';
class DriverScorecardPage extends StatelessWidget {
final String driverId;
const DriverScorecardPage({super.key, required this.driverId});
@override
Widget build(BuildContext context) {
QualityController controller = Get.put(QualityController());
// Fetch data when page opens
WidgetsBinding.instance.addPostFrameCallback((_) {
controller.fetchDriverScorecard(driverId);
});
return Scaffold(
appBar: AppBar(
title: const Text('بطاقة أداء السائق',
style: TextStyle(fontWeight: FontWeight.bold)),
backgroundColor: Colors.blueAccent,
),
body: GetBuilder<QualityController>(
builder: (controller) {
if (controller.isLoading) {
return const Center(child: CircularProgressIndicator());
}
if (controller.scorecardData.isEmpty) {
return const Center(
child: Text('لا توجد بيانات لهذا السائق أو حدث خطأ.'));
}
var basicInfo = controller.scorecardData['basic_info'];
var ridesStats = controller.scorecardData['rides_stats'];
var rating = controller.scorecardData['rating'];
var behavior = controller.scorecardData['behavior'];
var complaints = controller.scorecardData['complaints'];
num overallScore = controller.scorecardData['overall_score'] ?? 0;
Color scoreColor = _getScoreColor(overallScore);
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// رأس البطاقة - معلومات السائق والتقييم الإجمالي
Card(
elevation: 4,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15)),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
CircleAvatar(
radius: 40,
backgroundColor: Colors.grey.shade300,
child: const Icon(Icons.person,
size: 50, color: Colors.white),
),
const SizedBox(height: 10),
Text(
'${basicInfo['first_name']} ${basicInfo['last_name']}',
style: const TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
Text('هاتف: ${basicInfo['phone']}',
style: const TextStyle(color: Colors.grey)),
const Divider(height: 30),
Text('التقييم الشامل (Score)',
style: TextStyle(
fontSize: 18, color: Colors.grey.shade700)),
const SizedBox(height: 5),
Stack(
alignment: Alignment.center,
children: [
SizedBox(
width: 100,
height: 100,
child: CircularProgressIndicator(
value: overallScore / 100,
strokeWidth: 10,
backgroundColor: Colors.grey.shade200,
color: scoreColor,
),
),
Text('${overallScore.toStringAsFixed(1)}%',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: scoreColor)),
],
),
],
),
),
),
const SizedBox(height: 15),
// قسم إحصائيات الرحلات
_buildSectionTitle('إحصائيات الرحلات (الإنجاز)'),
Card(
elevation: 2,
child: ListTile(
leading: const Icon(Icons.drive_eta, color: Colors.blue),
title: const Text('نسبة الإنجاز'),
trailing: Text('${ridesStats['completion_rate']}%',
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.bold)),
subtitle: Text(
'إجمالي: ${ridesStats['total_rides']} | اكتمل: ${ridesStats['completed_rides']}\n'
'إلغاء سائق: ${ridesStats['driver_cancellations']} | إلغاء راكب: ${ridesStats['passenger_cancellations']}'),
),
),
const SizedBox(height: 10),
// قسم التقييم والشكاوى
_buildSectionTitle('رضا العملاء والشكاوى'),
Row(
children: [
Expanded(
child: Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
const Icon(Icons.star,
color: Colors.orange, size: 30),
const SizedBox(height: 5),
Text('${rating.toString()}/5.0',
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold)),
const Text('متوسط التقييم',
style: TextStyle(
fontSize: 12, color: Colors.grey)),
],
),
),
),
),
Expanded(
child: Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
const Icon(Icons.warning,
color: Colors.redAccent, size: 30),
const SizedBox(height: 5),
Text('${complaints['total_complaints']} شكوى',
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold)),
Text('${complaints['open_complaints']} مفتوحة',
style: const TextStyle(
fontSize: 12, color: Colors.red)),
],
),
),
),
),
],
),
const SizedBox(height: 10),
// قسم سلوك القيادة
_buildSectionTitle('سلوك القيادة والتتبع'),
Card(
elevation: 2,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
_buildBehaviorRow('متوسط سرعة السائق',
'${behavior['avg_max_speed']} كم/س', Icons.speed),
const Divider(),
_buildBehaviorRow(
'مرات الفرملة القاسية',
'${behavior['total_hard_brakes']}',
Icons.dangerous),
const Divider(),
_buildBehaviorRow(
'تسارع مفاجئ',
'${behavior['total_rapid_accel']}',
Icons.fast_forward),
const Divider(),
_buildBehaviorRow('تقييم السلوك الآلي',
'${behavior['avg_behavior_score']}%', Icons.memory),
],
),
),
),
],
),
);
},
),
);
}
Widget _buildSectionTitle(String title) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0),
child: Text(title,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87)),
);
}
Widget _buildBehaviorRow(String title, String value, IconData icon) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(icon, size: 20, color: Colors.grey.shade600),
const SizedBox(width: 8),
Text(title, style: const TextStyle(fontSize: 15)),
],
),
Text(value,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
],
);
}
Color _getScoreColor(num score) {
if (score >= 80) return Colors.green;
if (score >= 60) return Colors.orange;
return Colors.red;
}
}