Update: 2026-08-03 11:32:12
This commit is contained in:
@@ -9,6 +9,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
QualityController controller = Get.put(QualityController());
|
||||
// Fetch data when page opens
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -57,7 +58,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 40,
|
||||
backgroundColor: cs.onSurfaceVariant.shade300,
|
||||
backgroundColor: cs.onSurfaceVariant,
|
||||
child: const Icon(Icons.person,
|
||||
size: 50, color: Colors.white),
|
||||
),
|
||||
@@ -67,11 +68,11 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
style: const TextStyle(
|
||||
fontSize: 22, fontWeight: FontWeight.bold)),
|
||||
Text('هاتف: ${basicInfo['phone']}',
|
||||
style: const TextStyle(color: cs.onSurfaceVariant)),
|
||||
style: TextStyle(color: cs.onSurfaceVariant)),
|
||||
const Divider(height: 30),
|
||||
Text('التقييم الشامل (Score)',
|
||||
style: TextStyle(
|
||||
fontSize: 18, color: cs.onSurfaceVariant.shade700)),
|
||||
fontSize: 18, color: cs.onSurfaceVariant)),
|
||||
const SizedBox(height: 5),
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
@@ -82,7 +83,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
child: CircularProgressIndicator(
|
||||
value: overallScore / 100,
|
||||
strokeWidth: 10,
|
||||
backgroundColor: cs.onSurfaceVariant.shade200,
|
||||
backgroundColor: cs.onSurfaceVariant,
|
||||
color: scoreColor,
|
||||
),
|
||||
),
|
||||
@@ -104,7 +105,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
Card(
|
||||
elevation: 2,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.drive_eta, color: cs.info),
|
||||
leading: Icon(Icons.drive_eta, color: cs.info),
|
||||
title: const Text('نسبة الإنجاز'),
|
||||
trailing: Text('${ridesStats['completion_rate']}%',
|
||||
style: const TextStyle(
|
||||
@@ -128,14 +129,14 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Icon(Icons.star,
|
||||
Icon(Icons.star,
|
||||
color: cs.warning, size: 30),
|
||||
const SizedBox(height: 5),
|
||||
Text('${rating.toString()}/5.0',
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold)),
|
||||
const Text('متوسط التقييم',
|
||||
Text('متوسط التقييم',
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: cs.onSurfaceVariant)),
|
||||
],
|
||||
@@ -150,7 +151,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Icon(Icons.warning,
|
||||
Icon(Icons.warning,
|
||||
color: cs.danger, size: 30),
|
||||
const SizedBox(height: 5),
|
||||
Text('${complaints['total_complaints']} شكوى',
|
||||
@@ -158,7 +159,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('${complaints['open_complaints']} مفتوحة',
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: cs.danger)),
|
||||
],
|
||||
),
|
||||
@@ -217,12 +218,13 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildBehaviorRow(String title, String value, IconData icon) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, size: 20, color: cs.onSurfaceVariant.shade600),
|
||||
Icon(icon, size: 20, color: cs.onSurfaceVariant),
|
||||
const SizedBox(width: 8),
|
||||
Text(title, style: const TextStyle(fontSize: 15)),
|
||||
],
|
||||
@@ -234,6 +236,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Color _getScoreColor(num score) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
if (score >= 80) return cs.success;
|
||||
if (score >= 60) return cs.warning;
|
||||
return cs.danger;
|
||||
|
||||
Reference in New Issue
Block a user