Update: 2026-08-03 11:32:12
This commit is contained in:
@@ -9,7 +9,9 @@ import '../../widgets/elevated_btn.dart';
|
||||
import 'passenger_details_page.dart';
|
||||
|
||||
GetBuilder<PassengerAdminController> formSearchPassengers() {
|
||||
// DbSql sql = DbSql.instance;
|
||||
// دالة عليا بلا صنف ولا BuildContext في نطاقها؛ GetMaterialApp يوفّر
|
||||
// context عاماً عبر Get.context.
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return GetBuilder<PassengerAdminController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
@@ -74,7 +76,7 @@ GetBuilder<PassengerAdminController> formSearchPassengers() {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: cs.danger[300],
|
||||
color: cs.danger,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -18,6 +18,7 @@ class PassengerDetailsPage 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<PassengerAdminController>();
|
||||
|
||||
@@ -95,7 +96,7 @@ class PassengerDetailsPage extends StatelessWidget {
|
||||
Icons.star_rate_rounded,
|
||||
'Rating',
|
||||
'${data['ratingPassenger'] ?? 0.0}',
|
||||
valueColor: cs.warning[700],
|
||||
valueColor: cs.warning,
|
||||
),
|
||||
_buildDetailTile(
|
||||
Icons.directions_car_filled_outlined,
|
||||
@@ -132,6 +133,7 @@ class PassengerDetailsPage extends StatelessWidget {
|
||||
|
||||
// --- Header with Gradient/White Background ---
|
||||
Widget _buildHeaderSection(BuildContext context, Map<String, dynamic> data) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
String firstName = data['first_name'] ?? '';
|
||||
String lastName = data['last_name'] ?? '';
|
||||
String fullName = '$firstName $lastName'.trim();
|
||||
@@ -181,7 +183,7 @@ class PassengerDetailsPage extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
data['status'] ?? 'Active',
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: cs.info,
|
||||
fontWeight: FontWeight.w600),
|
||||
@@ -196,6 +198,7 @@ class PassengerDetailsPage 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(
|
||||
@@ -230,6 +233,7 @@ class PassengerDetailsPage 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(
|
||||
@@ -269,6 +273,7 @@ class PassengerDetailsPage extends StatelessWidget {
|
||||
PassengerAdminController controller,
|
||||
Map<String, dynamic> data,
|
||||
bool isSuperAdmin) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Column(
|
||||
children: [
|
||||
// --- Send Notification (For All Admins) ---
|
||||
@@ -321,7 +326,7 @@ class PassengerDetailsPage 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(
|
||||
@@ -365,6 +370,7 @@ class PassengerDetailsPage extends StatelessWidget {
|
||||
|
||||
void _showSendNotificationDialog(
|
||||
PassengerAdminController controller, Map<String, dynamic> data) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
Get.defaultDialog(
|
||||
title: 'Send Notification'.tr,
|
||||
titleStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
@@ -406,15 +412,16 @@ class PassengerDetailsPage 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,
|
||||
@@ -448,7 +455,7 @@ class PassengerDetailsPage 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)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user