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';
@@ -75,12 +76,12 @@ class CaptainDetailsPage extends StatelessWidget {
children: [
_buildDetailTile(Icons.star_rate_rounded, 'Rating',
'${data['ratingPassenger'] ?? 0.0} / 5.0',
valueColor: Colors.amber[700]),
valueColor: cs.warning[700]),
_buildDetailTile(Icons.directions_car_filled_outlined,
'Total Rides', data['countPassengerRide']),
_buildDetailTile(Icons.cancel_outlined,
'Canceled Rides', data['countPassengerCancel'],
valueColor: Colors.redAccent),
valueColor: cs.danger),
],
),
const SizedBox(height: 30),
@@ -107,7 +108,7 @@ class CaptainDetailsPage extends StatelessWidget {
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
color: cs.onSurfaceVariant.withValues(alpha: 0.1),
blurRadius: 10,
offset: const Offset(0, 5),
)
@@ -118,7 +119,7 @@ class CaptainDetailsPage extends StatelessWidget {
children: [
CircleAvatar(
radius: 45,
backgroundColor: AppColor.primaryColor.withOpacity(0.1),
backgroundColor: AppColor.primaryColor.withValues(alpha: 0.1),
child: Text(
data['first_name'] != null
? data['first_name'][0].toUpperCase()
@@ -141,14 +142,14 @@ class CaptainDetailsPage extends StatelessWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
color: Colors.green.withOpacity(0.1),
color: cs.success.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(20),
),
child: Text(
'Active Captain'.tr,
style: const TextStyle(
fontSize: 12,
color: Colors.green,
color: cs.success,
fontWeight: FontWeight.w600),
),
),
@@ -168,11 +169,11 @@ class CaptainDetailsPage extends StatelessWidget {
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.05),
color: cs.onSurfaceVariant.withValues(alpha: 0.05),
spreadRadius: 2,
blurRadius: 10)
],
border: Border.all(color: Colors.grey.withOpacity(0.1)),
border: Border.all(color: cs.onSurfaceVariant.withValues(alpha: 0.1)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -186,7 +187,7 @@ class CaptainDetailsPage extends StatelessWidget {
fontSize: 17, fontWeight: FontWeight.bold)),
],
),
Divider(height: 25, color: Colors.grey.withOpacity(0.2)),
Divider(height: 25, color: cs.onSurfaceVariant.withValues(alpha: 0.2)),
...children,
],
),
@@ -202,9 +203,9 @@ class CaptainDetailsPage extends StatelessWidget {
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.grey[100],
color: cs.onSurfaceVariant,
borderRadius: BorderRadius.circular(8)),
child: Icon(icon, color: Colors.grey[600], size: 18),
child: Icon(icon, color: cs.onSurfaceVariant, size: 18),
),
const SizedBox(width: 14),
Expanded(
@@ -212,7 +213,7 @@ class CaptainDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label.tr,
style: TextStyle(fontSize: 12, color: Colors.grey[500])),
style: TextStyle(fontSize: 12, color: cs.onSurfaceVariant)),
Text(
value?.toString() ?? 'N/A',
style: TextStyle(
@@ -244,7 +245,7 @@ class CaptainDetailsPage extends StatelessWidget {
label: Text("بطاقة الأداء (Scorecard)",
style: const TextStyle(color: Colors.white, fontSize: 16)),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueAccent,
backgroundColor: cs.info,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
),
@@ -306,8 +307,8 @@ class CaptainDetailsPage extends StatelessWidget {
icon: const Icon(Icons.delete_outline_rounded, size: 20),
label: Text("Delete".tr),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red[50],
foregroundColor: Colors.red,
backgroundColor: cs.danger[50],
foregroundColor: cs.danger,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
@@ -324,7 +325,7 @@ class CaptainDetailsPage extends StatelessWidget {
Text(
"Only Super Admins can edit or delete captains.",
style: TextStyle(
color: Colors.grey[400],
color: cs.onSurfaceVariant,
fontSize: 12,
fontStyle: FontStyle.italic),
)
@@ -394,7 +395,7 @@ class CaptainDetailsPage extends StatelessWidget {
),
cancel: TextButton(
onPressed: () => Get.back(),
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.grey))),
child: Text('Cancel'.tr, style: const TextStyle(color: cs.onSurfaceVariant))),
);
}
@@ -402,12 +403,12 @@ class CaptainDetailsPage extends StatelessWidget {
Get.defaultDialog(
title: 'Confirm Deletion'.tr,
titleStyle:
const TextStyle(color: Colors.redAccent, fontWeight: FontWeight.bold),
const TextStyle(color: cs.danger, fontWeight: FontWeight.bold),
middleText:
'Are you sure you want to delete ${user['first_name']}? This action cannot be undone.'
.tr,
confirm: ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: Colors.redAccent),
style: ElevatedButton.styleFrom(backgroundColor: cs.danger),
onPressed: () {
// Call delete function here
// controller.deleteCaptain(user['id']);
@@ -418,7 +419,7 @@ class CaptainDetailsPage extends StatelessWidget {
),
cancel: TextButton(
onPressed: () => Get.back(),
child: Text('Cancel'.tr, style: const TextStyle(color: Colors.grey))),
child: Text('Cancel'.tr, style: const TextStyle(color: cs.onSurfaceVariant))),
);
}
}
@@ -1,3 +1,4 @@
import 'package:siro_admin/constant/theme.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:siro_admin/controller/admin/register_captain_controller.dart';
@@ -614,7 +615,7 @@ Please fill in the JSON object with the extracted information, following these g
Text(
'${'License Expiry Date'.tr}: ${licenseExpiryDate.toString().substring(0, 10)}',
style: TextStyle(
color: isLicenseExpired ? Colors.red : Colors.green,
color: isLicenseExpired ? cs.danger : cs.success,
),
),
// Removed Fuel as it's not available
@@ -795,7 +796,7 @@ Please fill in the JSON object with the extracted information, following these g
Text(
'${'Tax Expiry Date'.tr}: $taxExpiryDate',
style: TextStyle(
color: isExpired ? Colors.red : Colors.green,
color: isExpired ? cs.danger : cs.success,
),
),
const SizedBox(height: 8.0),
@@ -806,7 +807,7 @@ Please fill in the JSON object with the extracted information, following these g
'${'Inspection Date'.tr}: $carBackLicenseExpired',
style: TextStyle(
color:
isInspectionExpired ? Colors.red : Colors.green,
isInspectionExpired ? cs.danger : cs.success,
),
),
],