Update: 2026-08-02 22:51:18

This commit is contained in:
Hamza-Ayed
2026-08-02 22:51:18 +03:00
parent c9af364cbc
commit 2c962bf80a
39 changed files with 627 additions and 191 deletions
@@ -1,3 +1,4 @@
import 'package:siro_admin/constant/theme.dart';
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -418,9 +419,9 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
'جارية',
controller.beginCount.toString(),
Icons.directions_car_rounded,
const Color(0xFF10B981), cs)),
cs.success, cs)),
Obx(() => _buildStatCard('جديدة', controller.newCount.toString(),
Icons.new_releases_rounded, const Color(0xFF3B82F6), cs)),
Icons.new_releases_rounded, cs.info, cs)),
Obx(() => _buildStatCard(
'مكتملة',
controller.completedCount.toString(),
@@ -430,12 +431,12 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
'ملغاة',
controller.canceledCount.toString(),
Icons.cancel_rounded,
const Color(0xFFEF4444), cs)),
cs.danger, cs)),
Obx(() => _buildStatCard(
'الإيرادات',
controller.totalRevenue.value.toStringAsFixed(0),
Icons.payments_rounded,
const Color(0xFFF59E0B), cs)),
cs.warning, cs)),
],
),
),
@@ -624,15 +625,15 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
children: [
Column(
children: [
const Icon(Icons.my_location_rounded,
size: 14, color: Color(0xFF10B981)),
Icon(Icons.my_location_rounded,
size: 14, color: cs.success),
Container(
width: 2,
height: 16,
color: Colors.grey.withOpacity(0.3),
margin: const EdgeInsets.symmetric(vertical: 2)),
const Icon(Icons.location_on_rounded,
size: 14, color: Color(0xFFEF4444)),
Icon(Icons.location_on_rounded,
size: 14, color: cs.danger),
],
),
const SizedBox(width: 10),
@@ -682,7 +683,7 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
title: 'السائق',
name: ride.driverName,
phone: ride.driverPhone,
color: const Color(0xFF3B82F6),
color: cs.info,
isAdmin: isAdmin,
),
const Padding(
@@ -709,19 +710,19 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
_buildInfoChip(
Icons.payments_rounded,
'${double.tryParse(ride.price)?.toStringAsFixed(0) ?? 0} ل.س',
const Color(0xFF10B981)),
cs.success),
const SizedBox(width: 8),
_buildInfoChip(
Icons.straighten_rounded,
'${double.tryParse(ride.distance)?.toStringAsFixed(1) ?? 0} كم',
const Color(0xFFF59E0B)),
cs.warning),
const SizedBox(width: 8),
_buildInfoChip(
Icons.access_time_rounded,
ride.time.length > 5
? ride.time.substring(0, 5)
: ride.time,
const Color(0xFF3B82F6)),
cs.info),
],
),
@@ -735,16 +736,16 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
width: double.infinity,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: const Color(0xFFEF4444).withOpacity(0.08),
color: cs.danger.withOpacity(0.08),
borderRadius: BorderRadius.circular(8),
border: Border.all(
color: const Color(0xFFEF4444).withOpacity(0.2)),
color: cs.danger.withOpacity(0.2)),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Icon(Icons.info_outline_rounded,
size: 16, color: Color(0xFFEF4444)),
Icon(Icons.info_outline_rounded,
size: 16, color: cs.danger),
const SizedBox(width: 6),
Expanded(
child: Text(
@@ -859,14 +860,15 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
// Helper Methods for Status
Color _getStatusColor(String status) {
final cs = Theme.of(context).colorScheme;
if (status == 'Begin' || status == 'Arrived') {
return const Color(0xFF10B981);
return cs.success;
}
if (status == 'Finished') return const Color(0xFF14B8A6);
if (status.contains('Cancel') || status == 'TimeOut') {
return const Color(0xFFEF4444);
return cs.danger;
}
if (status == 'New') return const Color(0xFF3B82F6);
if (status == 'New') return cs.info;
return Colors.grey;
}
@@ -976,6 +978,7 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return Scaffold(
appBar: AppBar(
title: Text(
@@ -1031,8 +1034,8 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
blurRadius: 5),
],
),
child: const Icon(Icons.flag_rounded,
color: Color(0xFF10B981), size: 24),
child: Icon(Icons.flag_rounded,
color: cs.success, size: 24),
),
alignment: Alignment.topCenter,
),
@@ -1052,8 +1055,8 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
blurRadius: 5),
],
),
child: const Icon(Icons.location_on_rounded,
color: Color(0xFFEF4444), size: 24),
child: Icon(Icons.location_on_rounded,
color: cs.danger, size: 24),
),
alignment: Alignment.topCenter,
),
@@ -1069,12 +1072,12 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: const Color(0xFF3B82F6).withOpacity(0.3),
color: cs.info.withOpacity(0.3),
blurRadius: 8),
],
),
child: const Icon(Icons.directions_car_rounded,
color: Color(0xFF3B82F6), size: 28),
child: Icon(Icons.directions_car_rounded,
color: cs.info, size: 28),
),
),
],
@@ -1110,7 +1113,7 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
title: 'السائق',
name: widget.ride.driverName,
phone: widget.ride.driverPhone,
color: const Color(0xFF3B82F6),
color: cs.info,
),
const SizedBox(height: 12),
// Passenger Info