Update: 2026-08-03 11:32:12
This commit is contained in:
@@ -304,30 +304,20 @@ class CaptainsPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(14),
|
||||
child: Row(
|
||||
children: [
|
||||
// شارة مصمتة بتدرّج وظل لكل صف تُثقل القائمة بصرياً؛
|
||||
// النمط الموحّد شارة خفيفة بحدّ رفيع.
|
||||
Container(
|
||||
width: 52,
|
||||
height: 52,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
cs.primary.withValues(alpha: 0.8),
|
||||
cs.primary,
|
||||
],
|
||||
),
|
||||
color: cs.primary.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.primary.withValues(alpha: 0.2),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
border: Border.all(
|
||||
color: cs.primary.withValues(alpha: 0.25)),
|
||||
),
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.person_rounded,
|
||||
color: Colors.white,
|
||||
color: cs.primary,
|
||||
size: 26,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/admin/captain_admin_controller.dart';
|
||||
import '../../../main.dart'; // Import main to access myPhone
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
@@ -18,6 +17,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final Map<String, dynamic> data = Get.arguments['data'];
|
||||
final controller = Get.find<CaptainAdminController>();
|
||||
String myPhone = box.read(BoxName.adminPhone).toString();
|
||||
@@ -76,7 +76,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
children: [
|
||||
_buildDetailTile(Icons.star_rate_rounded, 'Rating',
|
||||
'${data['ratingPassenger'] ?? 0.0} / 5.0',
|
||||
valueColor: cs.warning[700]),
|
||||
valueColor: cs.warning),
|
||||
_buildDetailTile(Icons.directions_car_filled_outlined,
|
||||
'Total Rides', data['countPassengerRide']),
|
||||
_buildDetailTile(Icons.cancel_outlined,
|
||||
@@ -101,25 +101,20 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
|
||||
// --- Header with Gradient Background ---
|
||||
Widget _buildHeaderSection(BuildContext context, Map<String, dynamic> data) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 25),
|
||||
// كان Colors.white ثابتاً: بطاقة بيضاء فوق خلفية داكنة في الوضع الداكن.
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.onSurfaceVariant.withValues(alpha: 0.1),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 5),
|
||||
)
|
||||
],
|
||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(30)),
|
||||
color: cs.surface,
|
||||
border: Border(bottom: BorderSide(color: cs.outline)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 45,
|
||||
backgroundColor: AppColor.primaryColor.withValues(alpha: 0.1),
|
||||
backgroundColor: cs.primary.withValues(alpha: 0.1),
|
||||
child: Text(
|
||||
data['first_name'] != null
|
||||
? data['first_name'][0].toUpperCase()
|
||||
@@ -127,7 +122,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 35,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.primaryColor),
|
||||
color: cs.primary),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
@@ -147,7 +142,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
'Active Captain'.tr,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: cs.success,
|
||||
fontWeight: FontWeight.w600),
|
||||
@@ -162,25 +157,20 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
{required String title,
|
||||
required IconData icon,
|
||||
required List<Widget> children}) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.onSurfaceVariant.withValues(alpha: 0.05),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 10)
|
||||
],
|
||||
border: Border.all(color: cs.onSurfaceVariant.withValues(alpha: 0.1)),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, color: AppColor.primaryColor, size: 22),
|
||||
Icon(icon, color: cs.primary, size: 22),
|
||||
const SizedBox(width: 10),
|
||||
Text(title.tr,
|
||||
style: const TextStyle(
|
||||
@@ -196,6 +186,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
|
||||
Widget _buildDetailTile(IconData icon, String label, dynamic value,
|
||||
{Color? valueColor}) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Row(
|
||||
@@ -234,6 +225,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
CaptainAdminController controller,
|
||||
Map<String, dynamic> data,
|
||||
bool isSuperAdmin) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Column(
|
||||
children: [
|
||||
// Driver Scorecard Button
|
||||
@@ -262,12 +254,12 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: ElevatedButton.icon(
|
||||
icon: const Icon(Icons.notifications_active_outlined,
|
||||
color: Colors.white),
|
||||
icon: Icon(Icons.notifications_active_outlined,
|
||||
color: cs.onPrimary),
|
||||
label: Text("Send Notification".tr,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 16)),
|
||||
style: TextStyle(color: cs.onPrimary, fontSize: 16)),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColor.primaryColor,
|
||||
backgroundColor: cs.primary,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
@@ -285,10 +277,10 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
icon: const Icon(Icons.edit_note_rounded, size: 20),
|
||||
label: Text("Edit".tr),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
foregroundColor: AppColor.yellowColor,
|
||||
backgroundColor: cs.warning.withValues(alpha: 0.10),
|
||||
foregroundColor: cs.warning,
|
||||
elevation: 0,
|
||||
side: BorderSide(color: AppColor.yellowColor),
|
||||
side: BorderSide(color: cs.warning.withValues(alpha: 0.4)),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
@@ -307,7 +299,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
icon: const Icon(Icons.delete_outline_rounded, size: 20),
|
||||
label: Text("Delete".tr),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: cs.danger[50],
|
||||
backgroundColor: cs.danger,
|
||||
foregroundColor: cs.danger,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -351,6 +343,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
|
||||
void _showSendNotificationDialog(
|
||||
CaptainAdminController controller, Map<String, dynamic> data) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
Get.defaultDialog(
|
||||
title: 'Send Notification'.tr,
|
||||
titleStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
@@ -395,15 +388,16 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
),
|
||||
cancel: TextButton(
|
||||
onPressed: () => Get.back(),
|
||||
child: Text('Cancel'.tr, style: const TextStyle(color: cs.onSurfaceVariant))),
|
||||
child: Text('Cancel'.tr, style: TextStyle(color: cs.onSurfaceVariant))),
|
||||
);
|
||||
}
|
||||
|
||||
void _showDeleteConfirmation(Map<String, dynamic> user) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
Get.defaultDialog(
|
||||
title: 'Confirm Deletion'.tr,
|
||||
titleStyle:
|
||||
const TextStyle(color: cs.danger, fontWeight: FontWeight.bold),
|
||||
TextStyle(color: cs.danger, fontWeight: FontWeight.bold),
|
||||
middleText:
|
||||
'Are you sure you want to delete ${user['first_name']}? This action cannot be undone.'
|
||||
.tr,
|
||||
@@ -419,7 +413,7 @@ class CaptainDetailsPage extends StatelessWidget {
|
||||
),
|
||||
cancel: TextButton(
|
||||
onPressed: () => Get.back(),
|
||||
child: Text('Cancel'.tr, style: const TextStyle(color: cs.onSurfaceVariant))),
|
||||
child: Text('Cancel'.tr, style: TextStyle(color: cs.onSurfaceVariant))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class DriverDetailsPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
controller.getDriverDetails(driverId);
|
||||
|
||||
return Scaffold(
|
||||
|
||||
@@ -14,6 +14,7 @@ class RegisterCaptain extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final controller = Get.put(RegisterCaptainController());
|
||||
// String text = '';
|
||||
controller.driveInit();
|
||||
@@ -532,6 +533,7 @@ Important notes:
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptCarLicenceFront() {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdCardDriverEgyptFront.isNotEmpty) {
|
||||
@@ -680,6 +682,7 @@ Please fill in the JSON object with the extracted information, following these g
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptCarLicenceBack() {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdCardDriverEgyptBack.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user