Update: 2026-08-03 00:20:40

This commit is contained in:
Hamza-Ayed
2026-08-03 00:20:40 +03:00
parent c23c3c0721
commit 2b9f696372
39 changed files with 38513 additions and 38217 deletions
@@ -1,3 +1,4 @@
import 'package:siro_admin/constant/theme.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart'; // Ensure get_storage is in pubspec.yaml
@@ -164,14 +165,14 @@ class DriverTheBestRedesigned extends StatelessWidget {
Row(
children: [
const Icon(Icons.access_time,
color: Colors.grey, size: 12),
color: cs.onSurfaceVariant, size: 12),
const SizedBox(width: 4),
Text(
ctrl.lastUpdated.isNotEmpty
? 'Updated: ${ctrl.lastUpdated}'
: 'Data Live',
style: TextStyle(
color: Colors.grey[400], fontSize: 12),
color: cs.onSurfaceVariant, fontSize: 12),
),
],
),
@@ -190,7 +191,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
textConfirm: "Yes, Clear",
textCancel: "Cancel",
confirmTextColor: Colors.white,
buttonColor: Colors.red,
buttonColor: cs.danger,
onConfirm: () {
ctrl.clearPaidStorage();
Get.back();
@@ -198,7 +199,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
);
},
icon: const Icon(Icons.delete_forever,
color: Colors.redAccent),
color: cs.danger),
tooltip: "Clear Paid Storage",
style: IconButton.styleFrom(
backgroundColor: Colors.white10),
@@ -209,7 +210,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
ctrl.fetchData();
},
icon: const Icon(Icons.refresh,
color: Colors.blueAccent),
color: cs.info),
style: IconButton.styleFrom(
backgroundColor: Colors.white10),
),
@@ -232,11 +233,11 @@ class DriverTheBestRedesigned extends StatelessWidget {
children: [
Expanded(
child: _buildStatCard('Total',
totalDrivers.toString(), Colors.blue)),
totalDrivers.toString(), cs.info)),
const SizedBox(width: 8),
Expanded(
child: _buildStatCard('Elite',
eliteCount.toString(), Colors.amber)),
eliteCount.toString(), cs.warning)),
],
),
),
@@ -247,13 +248,13 @@ class DriverTheBestRedesigned extends StatelessWidget {
children: [
Expanded(
child: _buildStatCard('Inactive',
inactiveCount.toString(), Colors.red)),
inactiveCount.toString(), cs.danger)),
const SizedBox(width: 8),
Expanded(
child: _buildStatCard(
'Max Time',
'${maxTime.toStringAsFixed(1)}h',
Colors.green)),
cs.success)),
],
),
),
@@ -266,7 +267,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
decoration: InputDecoration(
hintText: 'Search by phone number...',
prefixIcon:
const Icon(Icons.search, color: Colors.grey),
const Icon(Icons.search, color: cs.onSurfaceVariant),
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
@@ -275,7 +276,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.grey.shade200),
borderSide: BorderSide(color: cs.onSurfaceVariant.shade200),
),
),
),
@@ -291,7 +292,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
ctrl.searchQuery.isNotEmpty
? "No drivers found with this number"
: "No drivers available",
style: TextStyle(color: Colors.grey[400])),
style: TextStyle(color: cs.onSurfaceVariant)),
))
else
ListView.separated(
@@ -354,7 +355,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
border: Border(right: BorderSide(color: color, width: 4)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
color: cs.onSurfaceVariant.withValues(alpha: 0.1),
blurRadius: 4,
offset: const Offset(0, 2))
],
@@ -366,13 +367,13 @@ class DriverTheBestRedesigned extends StatelessWidget {
Text(title,
style: const TextStyle(
fontSize: 12,
color: Colors.grey,
color: cs.onSurfaceVariant,
fontWeight: FontWeight.bold)),
const SizedBox(height: 4),
Text(value,
style: TextStyle(
fontSize: 22,
color: color.withOpacity(0.8),
color: color.withValues(alpha: 0.8),
fontWeight: FontWeight.bold)),
],
),
@@ -390,21 +391,21 @@ class DriverTheBestRedesigned extends StatelessWidget {
Color statusColor;
if (hours >= 50) {
statusText = "Elite";
statusColor = Colors.amber;
statusColor = cs.warning;
} else if (hours >= 20) {
statusText = "Stable";
statusColor = Colors.green;
statusColor = cs.success;
} else if (hours >= 5) {
statusText = "Experimental";
statusColor = Colors.blue;
statusColor = cs.info;
} else {
statusText = "Inactive";
statusColor = Colors.red;
statusColor = cs.danger;
}
// Override colors if paid
Color cardBackground = isPaid ? Colors.teal.shade50 : Colors.white;
Color borderColor = isPaid ? Colors.teal : Colors.transparent;
Color cardBackground = isPaid ? cs.tertiary.shade50 : Colors.white;
Color borderColor = isPaid ? cs.tertiary : Colors.transparent;
// Calculate progress (max assumed 60 hours for 100% bar)
double progress = (hours / 60).clamp(0.0, 1.0);
@@ -417,7 +418,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.05),
color: cs.onSurfaceVariant.withValues(alpha: 0.05),
blurRadius: 10,
offset: const Offset(0, 4))
],
@@ -432,7 +433,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: Colors.teal,
color: cs.tertiary,
borderRadius: BorderRadius.circular(4)),
child: const Text("PAID",
style: TextStyle(
@@ -447,7 +448,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
children: [
// Avatar
CircleAvatar(
backgroundColor: statusColor.withOpacity(0.1),
backgroundColor: statusColor.withValues(alpha: 0.1),
radius: 24,
child: Text(
hours.toStringAsFixed(0),
@@ -468,7 +469,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 16,
color: isPaid
? Colors.teal.shade900
? cs.tertiary.shade900
: const Color(0xFF334155)),
),
const SizedBox(height: 4),
@@ -477,12 +478,12 @@ class DriverTheBestRedesigned extends StatelessWidget {
style: const TextStyle(
fontFamily: 'monospace',
fontSize: 12,
color: Colors.grey),
color: cs.onSurfaceVariant),
),
const SizedBox(height: 2),
Text(
driver['active_time'] ?? '',
style: TextStyle(fontSize: 10, color: Colors.grey[400]),
style: TextStyle(fontSize: 10, color: cs.onSurfaceVariant),
),
],
),
@@ -492,9 +493,9 @@ class DriverTheBestRedesigned extends StatelessWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: statusColor.withOpacity(0.1),
color: statusColor.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(4),
border: Border.all(color: statusColor.withOpacity(0.2)),
border: Border.all(color: statusColor.withValues(alpha: 0.2)),
),
child: Text(
statusText,
@@ -517,7 +518,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Performance",
style: TextStyle(fontSize: 10, color: Colors.grey[600])),
style: TextStyle(fontSize: 10, color: cs.onSurfaceVariant)),
Text("${hours.toStringAsFixed(2)} hrs",
style: const TextStyle(
fontSize: 10, fontWeight: FontWeight.bold)),
@@ -526,7 +527,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
const SizedBox(height: 4),
LinearProgressIndicator(
value: progress,
backgroundColor: Colors.grey[100],
backgroundColor: cs.onSurfaceVariant,
color: statusColor,
minHeight: 6,
borderRadius: BorderRadius.circular(3),
@@ -546,7 +547,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
isPaid
? const Text("Payment Completed",
style: TextStyle(
color: Colors.teal, fontWeight: FontWeight.bold))
color: cs.tertiary, fontWeight: FontWeight.bold))
: ElevatedButton.icon(
onPressed: () {
_showPayDialog(driver, controller);
@@ -554,7 +555,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
icon: const Icon(Icons.card_giftcard, size: 16),
label: Text("Pay Gift".tr),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.indigo, // Dark blue/purple
backgroundColor: cs.info, // Dark blue/purple
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 8),
@@ -588,7 +589,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
color: Color(0xFF0F172A), fontWeight: FontWeight.bold),
content: Column(
children: [
const Icon(Icons.wallet_giftcard, size: 50, color: Colors.indigo),
const Icon(Icons.wallet_giftcard, size: 50, color: cs.info),
const SizedBox(height: 10),
Text(
'Sending gift to ${driver['name_arabic']}',
@@ -609,7 +610,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
),
textConfirm: 'Pay Now',
confirmTextColor: Colors.white,
buttonColor: Colors.indigo,
buttonColor: cs.info,
onConfirm: () async {
final wallet = Get.put(WalletController());
@@ -1,3 +1,4 @@
import 'package:siro_admin/constant/map_tiles.dart';
import 'package:siro_admin/constant/theme.dart';
import 'dart:async';
import 'dart:convert';
@@ -515,10 +516,7 @@ class _SiroTrackerScreenState extends State<SiroTrackerScreen>
initialZoom: 10.0,
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.siromove.admin',
),
MapTiles.layer(context),
MarkerLayer(markers: _markers),
],
),
@@ -1,3 +1,4 @@
import 'package:siro_admin/constant/map_tiles.dart';
import 'package:siro_admin/constant/theme.dart';
import 'dart:async';
import 'package:flutter/material.dart';
@@ -404,10 +405,7 @@ class RideMonitorScreen extends StatelessWidget {
initialZoom: 12.0,
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.siromove.admin',
),
MapTiles.layer(context),
if (controller.routePolyline.isNotEmpty)
PolylineLayer(
polylines: [