Update: 2026-08-03 11:32:12

This commit is contained in:
Hamza-Ayed
2026-08-03 11:32:12 +03:00
parent 2b9f696372
commit 0334f9881f
40 changed files with 86899 additions and 84841 deletions
@@ -88,8 +88,8 @@ class DriverGiftCheckPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final controller = Get.put(DriverGiftCheckerController());
final cs = Theme.of(context).colorScheme;
final controller = Get.put(DriverGiftCheckerController());
return Scaffold(
backgroundColor: cs.surface,
@@ -91,6 +91,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return Scaffold(
backgroundColor: const Color(0xFFF8FAFC), // slate-50 background
body: SafeArea(
@@ -164,7 +165,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
const SizedBox(height: 4),
Row(
children: [
const Icon(Icons.access_time,
Icon(Icons.access_time,
color: cs.onSurfaceVariant, size: 12),
const SizedBox(width: 4),
Text(
@@ -198,7 +199,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
},
);
},
icon: const Icon(Icons.delete_forever,
icon: Icon(Icons.delete_forever,
color: cs.danger),
tooltip: "Clear Paid Storage",
style: IconButton.styleFrom(
@@ -209,7 +210,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
onPressed: () {
ctrl.fetchData();
},
icon: const Icon(Icons.refresh,
icon: Icon(Icons.refresh,
color: cs.info),
style: IconButton.styleFrom(
backgroundColor: Colors.white10),
@@ -267,16 +268,16 @@ class DriverTheBestRedesigned extends StatelessWidget {
decoration: InputDecoration(
hintText: 'Search by phone number...',
prefixIcon:
const Icon(Icons.search, color: cs.onSurfaceVariant),
Icon(Icons.search, color: cs.onSurfaceVariant),
filled: true,
fillColor: Colors.white,
fillColor: cs.surfaceContainerHighest,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: cs.onSurfaceVariant.shade200),
borderSide: BorderSide(color: cs.onSurfaceVariant),
),
),
),
@@ -347,10 +348,11 @@ class DriverTheBestRedesigned extends StatelessWidget {
}
Widget _buildStatCard(String title, String value, Color color) {
final cs = Theme.of(Get.context!).colorScheme;
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.white,
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(12),
border: Border(right: BorderSide(color: color, width: 4)),
boxShadow: [
@@ -365,7 +367,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(title,
style: const TextStyle(
style: TextStyle(
fontSize: 12,
color: cs.onSurfaceVariant,
fontWeight: FontWeight.bold)),
@@ -382,6 +384,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
Widget _buildDriverCard(BuildContext context, Map driver, int index,
DriverCacheController controller) {
final cs = Theme.of(context).colorScheme;
double hours = _calculateHoursFromStr(driver['active_time']);
String driverId = driver['id']?.toString() ?? 'null';
bool isPaid = controller.isDriverPaid(driverId);
@@ -404,7 +407,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
}
// Override colors if paid
Color cardBackground = isPaid ? cs.tertiary.shade50 : Colors.white;
Color cardBackground = isPaid ? cs.tertiary : Colors.white;
Color borderColor = isPaid ? cs.tertiary : Colors.transparent;
// Calculate progress (max assumed 60 hours for 100% bar)
@@ -469,13 +472,13 @@ class DriverTheBestRedesigned extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 16,
color: isPaid
? cs.tertiary.shade900
? cs.tertiary
: const Color(0xFF334155)),
),
const SizedBox(height: 4),
Text(
driver['phone'] ?? 'N/A',
style: const TextStyle(
style: TextStyle(
fontFamily: 'monospace',
fontSize: 12,
color: cs.onSurfaceVariant),
@@ -545,7 +548,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
children: [
// Pay Gift Button (The specific request)
isPaid
? const Text("Payment Completed",
? Text("Payment Completed",
style: TextStyle(
color: cs.tertiary, fontWeight: FontWeight.bold))
: ElevatedButton.icon(
@@ -571,6 +574,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
}
void _showPayDialog(Map driver, DriverCacheController controller) {
final cs = Theme.of(Get.context!).colorScheme;
// Check for valid ID immediately
String driverId = driver['driver_id']?.toString() ?? '';
String phone = driver['phone']?.toString() ?? '';
@@ -589,7 +593,7 @@ class DriverTheBestRedesigned extends StatelessWidget {
color: Color(0xFF0F172A), fontWeight: FontWeight.bold),
content: Column(
children: [
const Icon(Icons.wallet_giftcard, size: 50, color: cs.info),
Icon(Icons.wallet_giftcard, size: 50, color: cs.info),
const SizedBox(height: 10),
Text(
'Sending gift to ${driver['name_arabic']}',