Update: 2026-08-03 11:32:12
This commit is contained in:
@@ -403,6 +403,21 @@ class AppLink {
|
||||
"$paymentServerV2/Admin/v2/financial/settlements.php";
|
||||
static String financialStatsV2 =
|
||||
"$paymentServerV2/Admin/v2/financial/stats.php";
|
||||
// ملخّص محفظة سيرو من خادم المدفوعات (شهري/إجمالي/إيداع/صرف).
|
||||
// يحلّ محلّ siroWallet/get.php الذي كان يُرجع SUM(amount) بلا اسم للشهر
|
||||
// الجاري فقط، وهو غير منشور أصلاً (404 على v1 و v2).
|
||||
static String siroWalletSummary =
|
||||
"$paymentServerV2/ride/siroWallet/summary.php";
|
||||
// طلبات سحب أرصدة السائقين — جدول driver_withdrawal_requests كان يُكتب
|
||||
// فيه ولا يقرأه شيء في المنصّة كلها.
|
||||
static String withdrawalRequests =
|
||||
"$paymentServerV2/ride/driverPayment/withdrawal_requests.php";
|
||||
|
||||
// وحدة الطعام — الباك إند جاهز في backend/food/admin/ ولا واجهة له
|
||||
static String get foodMerchants => "$server/food/admin/merchants.php";
|
||||
static String get foodMerchantApprove =>
|
||||
"$server/food/admin/merchant_approve.php";
|
||||
static String get foodPayouts => "$server/food/admin/payouts.php";
|
||||
static String dashboardWalletV2 =
|
||||
"$paymentServerV2/Admin/v2/financial/dashboard_wallet.php";
|
||||
static String auditLogsV2 = "$server/Admin/v2/security/audit_logs.php";
|
||||
|
||||
@@ -10,6 +10,11 @@ class FinancialV2Controller extends GetxController {
|
||||
Map<String, dynamic> stats = {};
|
||||
List<dynamic> settlements = [];
|
||||
|
||||
/// ملخّص محفظة سيرو القادم من خادم المدفوعات.
|
||||
/// المفاتيح: month_to_date / previous_month / all_time / growth_percent
|
||||
/// / by_payment_method — ولكل نافذة: credits و debits و net و tx_count.
|
||||
Map<String, dynamic> walletSummary = {};
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -23,12 +28,28 @@ class FinancialV2Controller extends GetxController {
|
||||
await Future.wait([
|
||||
fetchStats(),
|
||||
fetchSettlements(),
|
||||
fetchWalletSummary(),
|
||||
]);
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> fetchWalletSummary() async {
|
||||
try {
|
||||
var res =
|
||||
await CRUD().getWallet(link: AppLink.siroWalletSummary, payload: {});
|
||||
if (res != 'failure' && res != null) {
|
||||
var d = res is String ? jsonDecode(res) : res;
|
||||
if (d['status'] == 'success' && d['data'] is Map) {
|
||||
walletSummary = Map<String, dynamic>.from(d['data']);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print('Error fetching Siro wallet summary: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> fetchStats() async {
|
||||
try {
|
||||
var res =
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
import 'dart:convert';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_admin/constant/links.dart';
|
||||
import 'package:siro_admin/controller/functions/crud.dart';
|
||||
import 'package:siro_admin/views/widgets/snackbar.dart';
|
||||
import '../../print.dart';
|
||||
|
||||
/// إدارة المطاعم (وحدة الطعام).
|
||||
/// الباك إند كان جاهزاً بالكامل في backend/food/admin/ منذ البداية
|
||||
/// (merchants / merchant_approve / payouts) دون أي واجهة في اللوحة.
|
||||
class FoodMerchantsController extends GetxController {
|
||||
bool isLoading = true;
|
||||
List<dynamic> merchants = [];
|
||||
String filter = 'all';
|
||||
|
||||
/// المطعم قيد المعالجة — لتعطيل أزراره أثناء الطلب
|
||||
int? busyId;
|
||||
|
||||
/// الحالات كما تقبلها backend/food/admin/merchants.php حرفياً
|
||||
static const statuses = <String, String>{
|
||||
'all': 'الكل',
|
||||
'pending_approval': 'بانتظار الاعتماد',
|
||||
'active': 'نشط',
|
||||
'paused': 'موقوف مؤقتاً',
|
||||
'suspended': 'معلّق',
|
||||
'rejected': 'مرفوض',
|
||||
};
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
fetchMerchants();
|
||||
}
|
||||
|
||||
Future<void> changeFilter(String next) async {
|
||||
if (filter == next) return;
|
||||
filter = next;
|
||||
await fetchMerchants();
|
||||
}
|
||||
|
||||
Future<void> fetchMerchants() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
|
||||
try {
|
||||
var res = await CRUD()
|
||||
.post(link: AppLink.foodMerchants, payload: {'status': filter});
|
||||
if (res != 'failure' && res != null) {
|
||||
var d = res is String ? jsonDecode(res) : res;
|
||||
if (d['status'] == 'success') {
|
||||
// jsonSuccess يغلّف الحمولة في message لا data
|
||||
final payload = d['message'] ?? d['data'];
|
||||
if (payload is Map && payload['merchants'] is List) {
|
||||
merchants = payload['merchants'];
|
||||
} else {
|
||||
merchants = [];
|
||||
}
|
||||
} else {
|
||||
mySnackbarError('${d['message'] ?? 'تعذّر جلب المطاعم'}');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print('Error fetching merchants: $e');
|
||||
mySnackbarError('$e');
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
/// approve أو reject — الخادم يقبلهما فقط لمطعم بحالة pending_approval.
|
||||
Future<void> decide(int merchantId, String action) async {
|
||||
busyId = merchantId;
|
||||
update();
|
||||
|
||||
try {
|
||||
var res = await CRUD().post(
|
||||
link: AppLink.foodMerchantApprove,
|
||||
payload: {
|
||||
'merchant_id': merchantId.toString(),
|
||||
'action': action,
|
||||
},
|
||||
);
|
||||
if (res != 'failure' && res != null) {
|
||||
var d = res is String ? jsonDecode(res) : res;
|
||||
if (d['status'] == 'success') {
|
||||
mySnackbarSuccess(
|
||||
action == 'approve' ? 'تم اعتماد المطعم' : 'تم رفض المطعم');
|
||||
busyId = null;
|
||||
await fetchMerchants();
|
||||
return;
|
||||
}
|
||||
mySnackbarError('${d['message'] ?? 'تعذّر تنفيذ الإجراء'}');
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print('Error deciding merchant: $e');
|
||||
mySnackbarError('$e');
|
||||
}
|
||||
|
||||
busyId = null;
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
import 'dart:convert';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_admin/constant/links.dart';
|
||||
import 'package:siro_admin/controller/functions/crud.dart';
|
||||
import 'package:siro_admin/views/widgets/snackbar.dart';
|
||||
import '../../print.dart';
|
||||
|
||||
/// طلبات سحب أرصدة السائقين (جدول driver_withdrawal_requests على خادم
|
||||
/// المدفوعات). لم تكن لها واجهة إطلاقاً قبل هذا: السائق يرسل الطلب فيُخزَّن
|
||||
/// وتُرسل رسالة واتساب لحظية، ثم لا يقرأ الجدول أحد.
|
||||
class WithdrawalController extends GetxController {
|
||||
bool isLoading = true;
|
||||
List<dynamic> requests = [];
|
||||
Map<String, dynamic> totals = {};
|
||||
String filter = 'pending';
|
||||
|
||||
/// المعرّف قيد المعالجة — لتعطيل أزرار الصف أثناء الطلب ومنع النقر المزدوج
|
||||
int? busyId;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
fetchRequests();
|
||||
}
|
||||
|
||||
Future<void> changeFilter(String next) async {
|
||||
if (filter == next) return;
|
||||
filter = next;
|
||||
await fetchRequests();
|
||||
}
|
||||
|
||||
Future<void> fetchRequests() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
|
||||
try {
|
||||
var res = await CRUD().getWallet(
|
||||
link: AppLink.withdrawalRequests,
|
||||
payload: {'action': 'list', 'status': filter},
|
||||
);
|
||||
if (res != 'failure' && res != null) {
|
||||
var d = res is String ? jsonDecode(res) : res;
|
||||
if (d['status'] == 'success' && d['data'] is Map) {
|
||||
requests = d['data']['requests'] ?? [];
|
||||
totals = Map<String, dynamic>.from(d['data']['totals'] ?? {});
|
||||
} else {
|
||||
mySnackbarError('${d['message'] ?? 'تعذّر جلب طلبات السحب'}');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print('Error fetching withdrawal requests: $e');
|
||||
mySnackbarError('$e');
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
/// تغيير الحالة يتطلّب super_admin على الخادم؛ الخادم يرفض أيضاً أي انتقال
|
||||
/// غير مسموح (مثل إعادة فتح طلب مرفوض) بـ 409، فنعرض رسالته كما هي.
|
||||
Future<void> updateStatus(int id, String status) async {
|
||||
busyId = id;
|
||||
update();
|
||||
|
||||
try {
|
||||
var res = await CRUD().getWallet(
|
||||
link: AppLink.withdrawalRequests,
|
||||
payload: {
|
||||
'action': 'update_status',
|
||||
'id': id.toString(),
|
||||
'status': status,
|
||||
},
|
||||
);
|
||||
if (res != 'failure' && res != null) {
|
||||
var d = res is String ? jsonDecode(res) : res;
|
||||
if (d['status'] == 'success') {
|
||||
mySnackbarSuccess('تم تحديث حالة الطلب');
|
||||
busyId = null;
|
||||
await fetchRequests();
|
||||
return;
|
||||
}
|
||||
mySnackbarError('${d['message'] ?? 'تعذّر تحديث الحالة'}');
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print('Error updating withdrawal status: $e');
|
||||
mySnackbarError('$e');
|
||||
}
|
||||
|
||||
busyId = null;
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,8 @@ import 'staff/pending_admins_page.dart';
|
||||
import 'dashboard_v2_widget.dart';
|
||||
import 'static/advanced_analytics_page.dart';
|
||||
import 'financial/financial_v2_page.dart';
|
||||
import 'financial/withdrawal_requests_page.dart';
|
||||
import 'food/food_merchants_page.dart';
|
||||
import 'security/audit_logs_page.dart';
|
||||
import 'analytics/live_analytics_page.dart';
|
||||
import 'package:siro_admin/views/widgets/responsive_layout.dart';
|
||||
@@ -1378,7 +1380,11 @@ class _AdminHomePageState extends State<AdminHomePage>
|
||||
title: 'المالية والإدارة',
|
||||
items: [
|
||||
ActionItem('الإدارة المالية V2', Icons.account_balance_rounded,
|
||||
const Color(0xFF6366F1), () => Get.to(() => const FinancialV2Page())),
|
||||
cs.primary, () => Get.to(() => const FinancialV2Page())),
|
||||
ActionItem('طلبات السحب', Icons.request_quote_rounded, cs.warning,
|
||||
() => Get.to(() => const WithdrawalRequestsPage())),
|
||||
ActionItem('إدارة المطاعم', Icons.storefront_rounded, cs.tertiary,
|
||||
() => Get.to(() => const FoodMerchantsPage())),
|
||||
ActionItem('المحفظة', Icons.account_balance_wallet_rounded, const Color(0xFF6366F1),
|
||||
() => Get.to(() => Wallet())),
|
||||
ActionItem('هدية 300', Icons.card_giftcard_rounded, cs.warning,
|
||||
@@ -1654,6 +1660,7 @@ class _GlowOrb extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
width: size,
|
||||
height: size,
|
||||
|
||||
@@ -13,8 +13,8 @@ class LiveAnalyticsPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final c = Get.put(LiveAnalyticsController());
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final c = Get.put(LiveAnalyticsController());
|
||||
|
||||
return DefaultTabController(
|
||||
length: 4,
|
||||
@@ -308,8 +308,8 @@ class _MapTabState extends State<_MapTab> with AutomaticKeepAliveClientMixin {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
super.build(context);
|
||||
final c = widget.ctrl;
|
||||
final rt = c.realtime;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -24,6 +24,7 @@ class DashboardStatCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
// Attempt to use AppStyle.boxDecoration1 properties if it's a BoxDecoration
|
||||
BoxDecoration? baseDecoration = AppStyle.boxDecoration1;
|
||||
Color? finalBackgroundColor =
|
||||
|
||||
@@ -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']}',
|
||||
|
||||
@@ -11,8 +11,8 @@ class EmployeePage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(EmployeeController());
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
Get.put(EmployeeController());
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
@@ -131,6 +131,7 @@ class _EmployeeCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
bool isExcellent = employee['status'].toString().contains('ممتاز');
|
||||
Color statusColor = isExcellent ? cs.success : cs.warning;
|
||||
|
||||
@@ -428,6 +429,7 @@ class _UploadButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return InkWell(
|
||||
onTap: onPressed,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
@@ -415,6 +415,7 @@ class _ErrorTile extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final isDriver = item.userType.toLowerCase().contains('driver') ||
|
||||
item.userType.toLowerCase().contains('سائق');
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ class FinancialV2Page extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildMainFinancialStats(ctrl.stats, cs),
|
||||
const SizedBox(height: 32),
|
||||
_buildSectionTitle('محفظة سيرو', cs),
|
||||
_buildSiroWalletSection(ctrl.walletSummary, cs),
|
||||
const SizedBox(height: 24),
|
||||
_buildSectionTitle('طرق الدفع', cs),
|
||||
_buildPaymentMethodBreakdown(ctrl.stats, cs),
|
||||
@@ -78,6 +81,116 @@ class FinancialV2Page extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// تنسيق مبلغ بفواصل آلاف وخانتين عشريتين.
|
||||
/// بلا رمز عملة عمداً: هذا النشر أردني بينما بطاقات هذه الشاشة الأخرى
|
||||
/// ما زالت تكتب "ج.م" ثابتة — راجع صحّتها قبل توحيد الرمز.
|
||||
String _money(double v) {
|
||||
final neg = v < 0;
|
||||
final parts = v.abs().toStringAsFixed(2).split('.');
|
||||
final digits = parts[0];
|
||||
final buf = StringBuffer();
|
||||
for (int i = 0; i < digits.length; i++) {
|
||||
if (i > 0 && (digits.length - i) % 3 == 0) buf.write(',');
|
||||
buf.write(digits[i]);
|
||||
}
|
||||
return '${neg ? '-' : ''}$buf.${parts[1]}';
|
||||
}
|
||||
|
||||
/// محفظة سيرو من خادم المدفوعات: الشهر الجاري مقابل الشهر السابق،
|
||||
/// والإجمالي التراكمي، مع فصل الإيداع عن الصرف.
|
||||
Widget _buildSiroWalletSection(
|
||||
Map<String, dynamic> summary, ColorScheme cs) {
|
||||
if (summary.isEmpty) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.account_balance_wallet_outlined,
|
||||
color: cs.onSurfaceVariant, size: 18),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'تعذّر جلب ملخّص المحفظة من خادم المدفوعات',
|
||||
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 13),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final mtd = (summary['month_to_date'] as Map?) ?? {};
|
||||
final allTime = (summary['all_time'] as Map?) ?? {};
|
||||
final growth = summary['growth_percent'];
|
||||
|
||||
double n(dynamic v) => double.tryParse('${v ?? 0}') ?? 0;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildFinancialCard(
|
||||
'صافي هذا الشهر',
|
||||
_money(n(mtd['net'])),
|
||||
Icons.calendar_month_rounded,
|
||||
cs.primary,
|
||||
cs,
|
||||
// المؤشّر يظهر فقط عند وجود شهر سابق يُقارن به
|
||||
subtitle: growth == null
|
||||
? null
|
||||
: '${n(growth) >= 0 ? '▲' : '▼'} ${n(growth).abs().toStringAsFixed(1)}% عن الشهر السابق',
|
||||
subtitleColor: growth == null
|
||||
? null
|
||||
: (n(growth) >= 0 ? cs.success : cs.danger),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildFinancialCard(
|
||||
'الإجمالي التراكمي',
|
||||
_money(n(allTime['net'])),
|
||||
Icons.savings_rounded,
|
||||
cs.tertiary,
|
||||
cs,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildFinancialCard(
|
||||
'إيداع هذا الشهر',
|
||||
_money(n(mtd['credits'])),
|
||||
Icons.south_west_rounded,
|
||||
cs.success,
|
||||
cs,
|
||||
subtitle: '${mtd['tx_count'] ?? 0} حركة',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildFinancialCard(
|
||||
'صرف هذا الشهر',
|
||||
_money(n(mtd['debits'])),
|
||||
Icons.north_east_rounded,
|
||||
cs.warning,
|
||||
cs,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSectionTitle(String title, ColorScheme cs) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
@@ -134,7 +247,7 @@ class FinancialV2Page extends StatelessWidget {
|
||||
|
||||
Widget _buildFinancialCard(
|
||||
String title, String value, IconData icon, Color color, ColorScheme cs,
|
||||
{bool isSmall = false}) {
|
||||
{bool isSmall = false, String? subtitle, Color? subtitleColor}) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(isSmall ? 16 : 24),
|
||||
decoration: BoxDecoration(
|
||||
@@ -170,6 +283,14 @@ class FinancialV2Page extends StatelessWidget {
|
||||
color: cs.onSurface,
|
||||
fontSize: isSmall ? 18 : 24,
|
||||
fontWeight: FontWeight.bold)),
|
||||
if (subtitle != null) ...[
|
||||
const SizedBox(height: 4),
|
||||
Text(subtitle,
|
||||
style: TextStyle(
|
||||
color: subtitleColor ?? cs.onSurfaceVariant,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600)),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_admin/constant/theme.dart';
|
||||
import 'package:siro_admin/controller/admin/withdrawal_controller.dart';
|
||||
|
||||
/// شاشة طلبات سحب أرصدة السائقين.
|
||||
/// تتبع لغة تصميم شاشة الرحلات: أسطح محايدة، واللون للمعنى وحده.
|
||||
class WithdrawalRequestsPage extends StatelessWidget {
|
||||
const WithdrawalRequestsPage({super.key});
|
||||
|
||||
static const _filters = <String, String>{
|
||||
'pending': 'معلّقة',
|
||||
'approved': 'معتمدة',
|
||||
'paid': 'مدفوعة',
|
||||
'rejected': 'مرفوضة',
|
||||
'all': 'الكل',
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
body: GetBuilder<WithdrawalController>(
|
||||
init: Get.isRegistered<WithdrawalController>()
|
||||
? Get.find<WithdrawalController>()
|
||||
: WithdrawalController(),
|
||||
builder: (ctrl) {
|
||||
return Column(
|
||||
children: [
|
||||
_buildHeader(context, ctrl, cs),
|
||||
_buildTotals(ctrl, cs),
|
||||
_buildFilterBar(ctrl, cs),
|
||||
Expanded(
|
||||
child: ctrl.isLoading
|
||||
? Center(child: CircularProgressIndicator(color: cs.primary))
|
||||
: _buildList(ctrl, cs),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeader(
|
||||
BuildContext context, WithdrawalController ctrl, ColorScheme cs) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surface,
|
||||
border: Border(bottom: BorderSide(color: cs.outline)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: Icon(Icons.arrow_back_ios_new_rounded,
|
||||
color: cs.onSurfaceVariant, size: 16),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text('طلبات السحب',
|
||||
style: TextStyle(
|
||||
color: cs.onSurface,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700)),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: Icon(Icons.refresh_rounded, color: cs.onSurfaceVariant),
|
||||
onPressed: () => ctrl.fetchRequests(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTotals(WithdrawalController ctrl, ColorScheme cs) {
|
||||
if (ctrl.totals.isEmpty) return const SizedBox.shrink();
|
||||
|
||||
Widget tile(String label, String key, Color color) {
|
||||
final t = ctrl.totals[key] as Map? ?? {};
|
||||
return Expanded(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 4),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(color: color.withValues(alpha: 0.22)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text('${t['count'] ?? 0}',
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w800)),
|
||||
const SizedBox(height: 2),
|
||||
Text(label,
|
||||
style:
|
||||
TextStyle(color: cs.onSurfaceVariant, fontSize: 11)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 12, 12, 4),
|
||||
child: Row(
|
||||
children: [
|
||||
tile('معلّقة', 'pending', cs.warning),
|
||||
tile('معتمدة', 'approved', cs.info),
|
||||
tile('مدفوعة', 'paid', cs.success),
|
||||
tile('مرفوضة', 'rejected', cs.danger),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFilterBar(WithdrawalController ctrl, ColorScheme cs) {
|
||||
return SizedBox(
|
||||
height: 52,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
children: _filters.entries.map((e) {
|
||||
final selected = ctrl.filter == e.key;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: GestureDetector(
|
||||
onTap: () => ctrl.changeFilter(e.key),
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: selected
|
||||
? cs.primary.withValues(alpha: 0.12)
|
||||
: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: selected ? cs.primary : cs.outline),
|
||||
),
|
||||
child: Text(
|
||||
e.value,
|
||||
style: TextStyle(
|
||||
color: selected ? cs.primary : cs.onSurfaceVariant,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildList(WithdrawalController ctrl, ColorScheme cs) {
|
||||
if (ctrl.requests.isEmpty) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.inbox_rounded, color: cs.onSurfaceVariant, size: 40),
|
||||
const SizedBox(height: 10),
|
||||
Text('لا توجد طلبات في هذه الحالة',
|
||||
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 13)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.fromLTRB(12, 4, 12, 24),
|
||||
itemCount: ctrl.requests.length,
|
||||
itemBuilder: (_, i) => _buildCard(ctrl, ctrl.requests[i], cs),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCard(WithdrawalController ctrl, dynamic r, ColorScheme cs) {
|
||||
final status = '${r['status'] ?? 'pending'}';
|
||||
final color = switch (status) {
|
||||
'approved' => cs.info,
|
||||
'paid' => cs.success,
|
||||
'rejected' => cs.danger,
|
||||
_ => cs.warning,
|
||||
};
|
||||
final id = int.tryParse('${r['id']}') ?? 0;
|
||||
final busy = ctrl.busyId == id;
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text('${r['driver_name'] ?? 'سائق غير معروف'}',
|
||||
style: TextStyle(
|
||||
color: cs.onSurface,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700)),
|
||||
),
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: color.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: Text(_filters[status] ?? status,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.payments_rounded, size: 14, color: color),
|
||||
const SizedBox(width: 6),
|
||||
Text('${r['amount'] ?? 0}',
|
||||
style: TextStyle(
|
||||
color: cs.onSurface,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800)),
|
||||
const SizedBox(width: 12),
|
||||
Icon(Icons.account_balance_wallet_outlined,
|
||||
size: 14, color: cs.onSurfaceVariant),
|
||||
const SizedBox(width: 6),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${r['wallet_type'] ?? ''} — ${r['wallet_number'] ?? ''}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style:
|
||||
TextStyle(color: cs.onSurfaceVariant, fontSize: 12),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text('#$id · ${r['created_at'] ?? ''}',
|
||||
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 11)),
|
||||
|
||||
// الإجراءات تظهر بحسب ما يقبله الخادم: من pending إلى أي حالة،
|
||||
// ومن approved إلى paid فقط. أي انتقال آخر يرفضه الخادم بـ 409.
|
||||
if (status == 'pending' || status == 'approved') ...[
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
if (status == 'pending') ...[
|
||||
_action(ctrl, id, 'approved', 'اعتماد', cs.info, cs, busy),
|
||||
const SizedBox(width: 8),
|
||||
_action(ctrl, id, 'rejected', 'رفض', cs.danger, cs, busy),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
_action(ctrl, id, 'paid', 'تم الدفع', cs.success, cs, busy),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _action(WithdrawalController ctrl, int id, String status, String label,
|
||||
Color color, ColorScheme cs, bool busy) {
|
||||
return Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: busy ? null : () => ctrl.updateStatus(id, status),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 9),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: busy ? 0.05 : 0.12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: color.withValues(alpha: busy ? 0.15 : 0.35)),
|
||||
),
|
||||
child: busy
|
||||
? SizedBox(
|
||||
width: 14,
|
||||
height: 14,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2, color: color),
|
||||
)
|
||||
: Text(label,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_admin/constant/theme.dart';
|
||||
import 'package:siro_admin/controller/admin/food_merchants_controller.dart';
|
||||
|
||||
/// إدارة المطاعم — قائمة، تصفية بالحالة، واعتماد/رفض الطلبات المعلّقة.
|
||||
/// تتبع لغة تصميم شاشة الرحلات: أسطح محايدة واللون للمعنى وحده.
|
||||
class FoodMerchantsPage extends StatelessWidget {
|
||||
const FoodMerchantsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
body: GetBuilder<FoodMerchantsController>(
|
||||
init: Get.isRegistered<FoodMerchantsController>()
|
||||
? Get.find<FoodMerchantsController>()
|
||||
: FoodMerchantsController(),
|
||||
builder: (ctrl) => Column(
|
||||
children: [
|
||||
_buildHeader(ctrl, cs),
|
||||
_buildFilterBar(ctrl, cs),
|
||||
Expanded(
|
||||
child: ctrl.isLoading
|
||||
? Center(child: CircularProgressIndicator(color: cs.primary))
|
||||
: _buildList(ctrl, cs),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeader(FoodMerchantsController ctrl, ColorScheme cs) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surface,
|
||||
border: Border(bottom: BorderSide(color: cs.outline)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: Icon(Icons.arrow_back_ios_new_rounded,
|
||||
color: cs.onSurfaceVariant, size: 16),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text('إدارة المطاعم',
|
||||
style: TextStyle(
|
||||
color: cs.onSurface,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700)),
|
||||
const Spacer(),
|
||||
Text('${ctrl.merchants.length}',
|
||||
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 12)),
|
||||
IconButton(
|
||||
icon: Icon(Icons.refresh_rounded, color: cs.onSurfaceVariant),
|
||||
onPressed: () => ctrl.fetchMerchants(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFilterBar(FoodMerchantsController ctrl, ColorScheme cs) {
|
||||
return SizedBox(
|
||||
height: 52,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
children: FoodMerchantsController.statuses.entries.map((e) {
|
||||
final selected = ctrl.filter == e.key;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: GestureDetector(
|
||||
onTap: () => ctrl.changeFilter(e.key),
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: selected
|
||||
? cs.primary.withValues(alpha: 0.12)
|
||||
: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border:
|
||||
Border.all(color: selected ? cs.primary : cs.outline),
|
||||
),
|
||||
child: Text(e.value,
|
||||
style: TextStyle(
|
||||
color: selected ? cs.primary : cs.onSurfaceVariant,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildList(FoodMerchantsController ctrl, ColorScheme cs) {
|
||||
if (ctrl.merchants.isEmpty) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.storefront_outlined,
|
||||
color: cs.onSurfaceVariant, size: 40),
|
||||
const SizedBox(height: 10),
|
||||
Text('لا توجد مطاعم في هذه الحالة',
|
||||
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 13)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.fromLTRB(12, 4, 12, 24),
|
||||
itemCount: ctrl.merchants.length,
|
||||
itemBuilder: (_, i) => _buildCard(ctrl, ctrl.merchants[i], cs),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCard(FoodMerchantsController ctrl, dynamic m, ColorScheme cs) {
|
||||
final status = '${m['status'] ?? ''}';
|
||||
final color = switch (status) {
|
||||
'active' => cs.success,
|
||||
'pending_approval' => cs.warning,
|
||||
'rejected' || 'suspended' => cs.danger,
|
||||
_ => cs.onSurfaceVariant,
|
||||
};
|
||||
final id = int.tryParse('${m['id']}') ?? 0;
|
||||
final busy = ctrl.busyId == id;
|
||||
final ratingCount = int.tryParse('${m['rating_count'] ?? 0}') ?? 0;
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(Icons.storefront_rounded, color: color, size: 18),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('${m['name_ar'] ?? m['name_en'] ?? 'بلا اسم'}',
|
||||
style: TextStyle(
|
||||
color: cs.onSurface,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700)),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
'${m['city'] ?? ''}${m['category'] != null ? ' · ${m['category']}' : ''}',
|
||||
style: TextStyle(
|
||||
color: cs.onSurfaceVariant, fontSize: 11),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: color.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: Text(
|
||||
FoodMerchantsController.statuses[status] ?? status,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.percent_rounded,
|
||||
size: 13, color: cs.onSurfaceVariant),
|
||||
const SizedBox(width: 4),
|
||||
Text('عمولة ${m['commission_percent'] ?? 0}%',
|
||||
style:
|
||||
TextStyle(color: cs.onSurfaceVariant, fontSize: 11)),
|
||||
const SizedBox(width: 14),
|
||||
Icon(Icons.star_rounded, size: 13, color: cs.warning),
|
||||
const SizedBox(width: 4),
|
||||
// بلا تقييمات نعرض شرطة بدل 0.0 حتى لا يُقرأ كتقييم سيئ
|
||||
Text(
|
||||
ratingCount == 0
|
||||
? 'لا تقييمات'
|
||||
: '${m['rating_avg'] ?? 0} ($ratingCount)',
|
||||
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 11),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (status == 'pending_approval') ...[
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
_action(ctrl, id, 'approve', 'اعتماد', cs.success, busy),
|
||||
const SizedBox(width: 8),
|
||||
_action(ctrl, id, 'reject', 'رفض', cs.danger, busy),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _action(FoodMerchantsController ctrl, int id, String action,
|
||||
String label, Color color, bool busy) {
|
||||
return Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: busy ? null : () => ctrl.decide(id, action),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 9),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: busy ? 0.05 : 0.12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: color.withValues(alpha: busy ? 0.15 : 0.35)),
|
||||
),
|
||||
child: busy
|
||||
? SizedBox(
|
||||
width: 14,
|
||||
height: 14,
|
||||
child:
|
||||
CircularProgressIndicator(strokeWidth: 2, color: color),
|
||||
)
|
||||
: Text(label,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ class _HeatmapPageState extends State<HeatmapPage> {
|
||||
}
|
||||
|
||||
Future<void> _fetchHeatmapData() async {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
setState(() => _isLoading = true);
|
||||
try {
|
||||
final queryParams = {
|
||||
@@ -364,6 +365,7 @@ class _LegendItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
||||
@@ -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)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,12 +165,12 @@ class KazanEditorPage extends StatelessWidget {
|
||||
'speedPrice': {
|
||||
'label': 'Speed ⚡',
|
||||
'icon': Icons.flash_on_rounded,
|
||||
'color': cs.warning.shade700
|
||||
'color': cs.warning
|
||||
},
|
||||
'comfortPrice': {
|
||||
'label': 'Comfort ❄️',
|
||||
'icon': Icons.chair_rounded,
|
||||
'color': cs.info.shade700
|
||||
'color': cs.info
|
||||
},
|
||||
'ladyPrice': {
|
||||
'label': 'Lady 👩',
|
||||
@@ -180,7 +180,7 @@ class KazanEditorPage extends StatelessWidget {
|
||||
'electricPrice': {
|
||||
'label': 'Electric 🔋',
|
||||
'icon': Icons.electric_car_rounded,
|
||||
'color': cs.success.shade700
|
||||
'color': cs.success
|
||||
},
|
||||
'vanPrice': {
|
||||
'label': 'Van 🚐',
|
||||
@@ -190,17 +190,17 @@ class KazanEditorPage extends StatelessWidget {
|
||||
'deliveryPrice': {
|
||||
'label': 'Delivery 📦',
|
||||
'icon': Icons.delivery_dining_rounded,
|
||||
'color': cs.warning.shade700
|
||||
'color': cs.warning
|
||||
},
|
||||
'mishwarVipPrice': {
|
||||
'label': 'Mishwar Vip ⭐',
|
||||
'icon': Icons.star_rounded,
|
||||
'color': cs.warning.shade900
|
||||
'color': cs.warning
|
||||
},
|
||||
'fixedPrice': {
|
||||
'label': 'Fixed Price 💰',
|
||||
'icon': Icons.money_rounded,
|
||||
'color': cs.tertiary.shade700
|
||||
'color': cs.tertiary
|
||||
},
|
||||
'awfarPrice': {
|
||||
'label': 'Awfar Car 🚗',
|
||||
|
||||
@@ -9,6 +9,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
QualityController controller = Get.put(QualityController());
|
||||
// Fetch data when page opens
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -57,7 +58,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 40,
|
||||
backgroundColor: cs.onSurfaceVariant.shade300,
|
||||
backgroundColor: cs.onSurfaceVariant,
|
||||
child: const Icon(Icons.person,
|
||||
size: 50, color: Colors.white),
|
||||
),
|
||||
@@ -67,11 +68,11 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
style: const TextStyle(
|
||||
fontSize: 22, fontWeight: FontWeight.bold)),
|
||||
Text('هاتف: ${basicInfo['phone']}',
|
||||
style: const TextStyle(color: cs.onSurfaceVariant)),
|
||||
style: TextStyle(color: cs.onSurfaceVariant)),
|
||||
const Divider(height: 30),
|
||||
Text('التقييم الشامل (Score)',
|
||||
style: TextStyle(
|
||||
fontSize: 18, color: cs.onSurfaceVariant.shade700)),
|
||||
fontSize: 18, color: cs.onSurfaceVariant)),
|
||||
const SizedBox(height: 5),
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
@@ -82,7 +83,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
child: CircularProgressIndicator(
|
||||
value: overallScore / 100,
|
||||
strokeWidth: 10,
|
||||
backgroundColor: cs.onSurfaceVariant.shade200,
|
||||
backgroundColor: cs.onSurfaceVariant,
|
||||
color: scoreColor,
|
||||
),
|
||||
),
|
||||
@@ -104,7 +105,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
Card(
|
||||
elevation: 2,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.drive_eta, color: cs.info),
|
||||
leading: Icon(Icons.drive_eta, color: cs.info),
|
||||
title: const Text('نسبة الإنجاز'),
|
||||
trailing: Text('${ridesStats['completion_rate']}%',
|
||||
style: const TextStyle(
|
||||
@@ -128,14 +129,14 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Icon(Icons.star,
|
||||
Icon(Icons.star,
|
||||
color: cs.warning, size: 30),
|
||||
const SizedBox(height: 5),
|
||||
Text('${rating.toString()}/5.0',
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold)),
|
||||
const Text('متوسط التقييم',
|
||||
Text('متوسط التقييم',
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: cs.onSurfaceVariant)),
|
||||
],
|
||||
@@ -150,7 +151,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Icon(Icons.warning,
|
||||
Icon(Icons.warning,
|
||||
color: cs.danger, size: 30),
|
||||
const SizedBox(height: 5),
|
||||
Text('${complaints['total_complaints']} شكوى',
|
||||
@@ -158,7 +159,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('${complaints['open_complaints']} مفتوحة',
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: cs.danger)),
|
||||
],
|
||||
),
|
||||
@@ -217,12 +218,13 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildBehaviorRow(String title, String value, IconData icon) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, size: 20, color: cs.onSurfaceVariant.shade600),
|
||||
Icon(icon, size: 20, color: cs.onSurfaceVariant),
|
||||
const SizedBox(width: 8),
|
||||
Text(title, style: const TextStyle(fontSize: 15)),
|
||||
],
|
||||
@@ -234,6 +236,7 @@ class DriverScorecardPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Color _getScoreColor(num score) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
if (score >= 80) return cs.success;
|
||||
if (score >= 60) return cs.warning;
|
||||
return cs.danger;
|
||||
|
||||
@@ -985,8 +985,8 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
|
||||
'تتبع الرحلة #${widget.ride.rideId}',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
foregroundColor: const Color(0xFF2B3674),
|
||||
backgroundColor: cs.surface,
|
||||
foregroundColor: cs.onSurface,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
),
|
||||
@@ -1131,8 +1131,8 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
|
||||
top: 16,
|
||||
right: 16,
|
||||
child: FloatingActionButton.small(
|
||||
backgroundColor: Colors.white,
|
||||
foregroundColor: const Color(0xFF2B3674),
|
||||
backgroundColor: cs.surface,
|
||||
foregroundColor: cs.onSurface,
|
||||
onPressed: _fitBounds,
|
||||
child: const Icon(Icons.center_focus_strong_rounded),
|
||||
),
|
||||
|
||||
@@ -8,8 +8,8 @@ class ServerMonitorPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = Get.put(ServerMonitorController());
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final controller = Get.put(ServerMonitorController());
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
@@ -491,7 +491,7 @@ class _TopProcessesCard extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: cs.warning.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8)),
|
||||
child: const Icon(Icons.analytics_rounded,
|
||||
child: Icon(Icons.analytics_rounded,
|
||||
color: cs.warning, size: 18),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
@@ -555,7 +555,7 @@ class _TopProcessesCard extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
process.usage,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
color: cs.warning,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold),
|
||||
@@ -654,7 +654,7 @@ class _ErrorState extends StatelessWidget {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.cloud_off_rounded,
|
||||
Icon(Icons.cloud_off_rounded,
|
||||
size: 60, color: cs.danger),
|
||||
const SizedBox(height: 16),
|
||||
Text(controller.errorMessage.value,
|
||||
|
||||
@@ -8,9 +8,9 @@ class AddStaffPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final controller = Get.put(StaffController());
|
||||
controller.selectedRole = role;
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
|
||||
@@ -651,6 +651,7 @@ class _LegendDot extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
||||
@@ -11,6 +11,7 @@ class DailyNotesView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
// نستخدم نفس الكونترولر للوصول لدالة جلب الملاحظات
|
||||
final controller = Get.find<StaticController>();
|
||||
|
||||
@@ -31,9 +32,9 @@ class DailyNotesView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: cs.surface,
|
||||
elevation: 0,
|
||||
iconTheme: const IconThemeData(color: Colors.black87),
|
||||
iconTheme: IconThemeData(color: cs.onSurface),
|
||||
),
|
||||
body: GetBuilder<StaticController>(
|
||||
builder: (controller) {
|
||||
@@ -47,10 +48,10 @@ class DailyNotesView extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.note_alt_outlined,
|
||||
size: 80, color: cs.onSurfaceVariant.shade300),
|
||||
size: 80, color: cs.onSurfaceVariant),
|
||||
const SizedBox(height: 10),
|
||||
Text("لا توجد سجلات لهذا اليوم",
|
||||
style: TextStyle(color: cs.onSurfaceVariant.shade600)),
|
||||
style: TextStyle(color: cs.onSurfaceVariant)),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -102,7 +103,7 @@ class DailyNotesView extends StatelessWidget {
|
||||
name.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: cs.onSurfaceVariant.shade800,
|
||||
color: cs.onSurfaceVariant,
|
||||
fontSize: 14),
|
||||
),
|
||||
const SizedBox(width: 100),
|
||||
@@ -116,7 +117,7 @@ class DailyNotesView extends StatelessWidget {
|
||||
phone,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: cs.onSurfaceVariant.shade800,
|
||||
color: cs.onSurfaceVariant,
|
||||
fontSize: 14),
|
||||
),
|
||||
Icon(Icons.phone)
|
||||
@@ -127,7 +128,7 @@ class DailyNotesView extends StatelessWidget {
|
||||
Text(
|
||||
time.split(' ').last, // عرض الوقت فقط
|
||||
style: TextStyle(
|
||||
color: cs.onSurfaceVariant.shade400, fontSize: 12),
|
||||
color: cs.onSurfaceVariant, fontSize: 12),
|
||||
textDirection: TextDirection.ltr,
|
||||
),
|
||||
],
|
||||
@@ -139,7 +140,7 @@ class DailyNotesView extends StatelessWidget {
|
||||
content,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: cs.onSurfaceVariant.shade700,
|
||||
color: cs.onSurfaceVariant,
|
||||
height: 1.5),
|
||||
),
|
||||
],
|
||||
@@ -153,9 +154,10 @@ class DailyNotesView extends StatelessWidget {
|
||||
}
|
||||
|
||||
Color _getEmployeeColor(String name) {
|
||||
final cs = Theme.of(Get.context!).colorScheme;
|
||||
String n = name.toLowerCase().trim();
|
||||
if (n.contains('shahd')) return cs.danger;
|
||||
if (n.contains('mayar')) return cs.warning.shade700;
|
||||
if (n.contains('mayar')) return cs.warning;
|
||||
if (n.contains('rama2')) return cs.success;
|
||||
if (n.contains('rama1')) return cs.info;
|
||||
return Colors.blueGrey;
|
||||
|
||||
@@ -175,6 +175,7 @@ class _SliverHeader extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return SliverAppBar(
|
||||
expandedHeight: 100,
|
||||
pinned: true,
|
||||
@@ -275,6 +276,7 @@ class _DateBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 4),
|
||||
child: Row(
|
||||
@@ -351,6 +353,7 @@ class _KpiRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final items = [
|
||||
_KpiItem('الركاب', controller.totalMonthlyPassengers,
|
||||
Icons.groups_rounded, cs.tertiary),
|
||||
@@ -477,6 +480,7 @@ class _ChartCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final allSpots = [...spots, ...?compareSpots];
|
||||
final maxY = _maxY(allSpots);
|
||||
final interval = _interval(maxY);
|
||||
@@ -605,6 +609,7 @@ class _DynamicMultiLineCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final employees = controller.employeeData.values.toList();
|
||||
employees.sort((a, b) => getTotal(b).compareTo(getTotal(a)));
|
||||
|
||||
@@ -762,6 +767,7 @@ class _LegendChip extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
decoration: BoxDecoration(
|
||||
@@ -802,6 +808,7 @@ class _EmployeeLeaderboard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final maxCount = stats.isEmpty ? 1 : stats.first.count;
|
||||
|
||||
return Padding(
|
||||
@@ -929,6 +936,7 @@ class _RankBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final isTop3 = rank <= 3;
|
||||
final medalColors = [
|
||||
cs.warning,
|
||||
@@ -974,6 +982,7 @@ class _ControlBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
@@ -1101,6 +1110,7 @@ class _LoadingState extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
@@ -131,6 +131,7 @@ class _AddInvoicePageState extends State<AddInvoicePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Scaffold(
|
||||
backgroundColor: bgColor,
|
||||
appBar: AppBar(
|
||||
@@ -222,7 +223,7 @@ class _AddInvoicePageState extends State<AddInvoicePage> {
|
||||
border: Border.all(
|
||||
color: _imageFile != null
|
||||
? primaryColor
|
||||
: cs.onSurfaceVariant.shade300,
|
||||
: cs.onSurfaceVariant,
|
||||
width: 2,
|
||||
style: _imageFile != null
|
||||
? BorderStyle.solid
|
||||
@@ -356,6 +357,7 @@ class _AddInvoicePageState extends State<AddInvoicePage> {
|
||||
required String hint,
|
||||
bool isNumber = false,
|
||||
}) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return TextFormField(
|
||||
controller: controller,
|
||||
keyboardType: isNumber
|
||||
@@ -379,7 +381,7 @@ class _AddInvoicePageState extends State<AddInvoicePage> {
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: cs.onSurfaceVariant.shade200),
|
||||
borderSide: BorderSide(color: cs.onSurfaceVariant),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
@@ -132,25 +132,15 @@ class _InvoiceListPageState extends State<InvoiceListPage> {
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
floatingActionButton: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(colors: [cs.primary, cs.primary.withValues(alpha: 0.7)]),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.primary.withValues(alpha: 0.3),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 4))
|
||||
],
|
||||
),
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () => Get.to(() => AddInvoicePage()),
|
||||
label: const Text('إضافة فاتورة',
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
icon: const Icon(Icons.add_rounded),
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
),
|
||||
// الإجراء الأساسي هو الموضع الوحيد الذي يستحق لوناً ممتلئاً في الشاشة.
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () => Get.to(() => AddInvoicePage()),
|
||||
label: const Text('إضافة فاتورة',
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
icon: const Icon(Icons.add_rounded),
|
||||
backgroundColor: cs.primary,
|
||||
foregroundColor: cs.onPrimary,
|
||||
elevation: 0,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
@@ -188,23 +178,11 @@ class _InvoiceListPageState extends State<InvoiceListPage> {
|
||||
left: 20,
|
||||
right: 20,
|
||||
),
|
||||
// سطح محايد بحدّ سفلي بدل الشريحة المتدرّجة بلون primary وظلّها —
|
||||
// نفس المبدأ المطبّق في شاشة الرحلات: اللون للمعنى لا للإطار.
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [cs.primary, cs.primary.withValues(alpha: 0.7)],
|
||||
),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(24),
|
||||
bottomRight: Radius.circular(24),
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: cs.primary.withValues(alpha: 0.2),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
color: cs.surface,
|
||||
border: Border(bottom: BorderSide(color: cs.outline)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -215,18 +193,19 @@ class _InvoiceListPageState extends State<InvoiceListPage> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
color: cs.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: cs.outline),
|
||||
),
|
||||
child: const Icon(Icons.arrow_back_ios_new_rounded,
|
||||
color: Colors.white, size: 16),
|
||||
child: Icon(Icons.arrow_back_ios_new_rounded,
|
||||
color: cs.onSurfaceVariant, size: 16),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
const Text(
|
||||
Text(
|
||||
"سجل الفواتير",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: cs.onSurface,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
@@ -246,7 +225,7 @@ class _InvoiceListPageState extends State<InvoiceListPage> {
|
||||
isMoney: true,
|
||||
),
|
||||
),
|
||||
Container(width: 1, height: 40, color: Colors.white24),
|
||||
Container(width: 1, height: 40, color: cs.outline),
|
||||
Expanded(
|
||||
child: _buildSummaryItem(
|
||||
title: "عدد الفواتير",
|
||||
@@ -268,29 +247,37 @@ class _InvoiceListPageState extends State<InvoiceListPage> {
|
||||
required IconData icon,
|
||||
required bool isMoney,
|
||||
}) {
|
||||
// بعد تحييد الرأس لم يعد الأبيض مقروءاً. المبلغ يأخذ لون النجاح
|
||||
// والعدّ يأخذ لون النص الأساسي — اللون هنا يحمل معنى لا زينة.
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final accent = isMoney ? cs.success : cs.primary;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
color: accent.withValues(alpha: 0.12),
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: accent.withValues(alpha: 0.25)),
|
||||
),
|
||||
child: Icon(icon, color: Colors.white, size: 20),
|
||||
child: Icon(icon, color: accent, size: 20),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
color: isMoney ? const Color(0xFFD1FAE5) : Colors.white,
|
||||
color: isMoney ? cs.success : cs.onSurface,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
color: Colors.white, fontSize: 11, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: cs.onSurfaceVariant,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -31,8 +31,8 @@ class GlassContainer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
final defaultGradient = isDark
|
||||
? [
|
||||
|
||||
@@ -82,6 +82,7 @@ class _SnackContentState extends State<_SnackContent>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
final v = widget.variant;
|
||||
final accent = v.baseColor;
|
||||
final surface = v.surfaceColor;
|
||||
|
||||
@@ -23,6 +23,8 @@ import 'package:siro_admin/views/admin/staff/add_staff_page.dart';
|
||||
import 'package:siro_admin/views/admin/staff/pending_admins_page.dart';
|
||||
import 'package:siro_admin/views/admin/static/advanced_analytics_page.dart';
|
||||
import 'package:siro_admin/views/admin/financial/financial_v2_page.dart';
|
||||
import 'package:siro_admin/views/admin/financial/withdrawal_requests_page.dart';
|
||||
import 'package:siro_admin/views/admin/food/food_merchants_page.dart';
|
||||
import 'package:siro_admin/views/admin/security/audit_logs_page.dart';
|
||||
import 'package:siro_admin/views/admin/analytics/live_analytics_page.dart';
|
||||
|
||||
@@ -178,6 +180,20 @@ class WebSidebar extends StatelessWidget {
|
||||
index: 108,
|
||||
onTap: () => Get.to(() => const FinancialV2Page()),
|
||||
),
|
||||
_buildNavItem(
|
||||
context,
|
||||
title: 'طلبات السحب',
|
||||
icon: Icons.request_quote_rounded,
|
||||
index: 112,
|
||||
onTap: () => Get.to(() => const WithdrawalRequestsPage()),
|
||||
),
|
||||
_buildNavItem(
|
||||
context,
|
||||
title: 'إدارة المطاعم',
|
||||
icon: Icons.storefront_rounded,
|
||||
index: 113,
|
||||
onTap: () => Get.to(() => const FoodMerchantsPage()),
|
||||
),
|
||||
_buildNavItem(
|
||||
context,
|
||||
title: 'المحافظ المالية',
|
||||
|
||||
Reference in New Issue
Block a user