Files
Hamza-AyedandClaude Opus 5 0aab85c732 refactor: إعادة تسمية التطبيقات الأربعة siro_* → intaleq_*
المجلدات وأسماء حزم dart واستيراداتها:
  siro_rider → intaleq_rider    siro_driver  → intaleq_driver
  siro_admin → intaleq_admin    siro_service → intaleq_service

شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات
(115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في
backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت).

+ ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت
مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت
تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع
تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة.

⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER ·
shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها
كوميت منفصل، والهويات تحتاج قرار المالك.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 16:10:58 +03:00

258 lines
8.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controller/admin/wallet_admin_controller.dart';
import '../../widgets/mycircular.dart';
class Wallet extends StatelessWidget {
Wallet({super.key});
final WalletAdminController walletAdminController =
Get.put(WalletAdminController());
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return Scaffold(
backgroundColor: cs.surface,
body: Column(
children: [
_buildAppBar(context, cs),
Expanded(
child: GetBuilder<WalletAdminController>(
builder: (controller) {
if (controller.isLoading) {
return _buildLoadingState(cs);
}
if (controller.driversWalletPoints.isEmpty) {
return _buildEmptyState(cs);
}
return Column(
children: [
_buildPayAllButton(context, controller, cs),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 80),
physics: const BouncingScrollPhysics(),
itemCount: controller.driversWalletPoints.length,
separatorBuilder: (_, __) => const SizedBox(height: 10),
itemBuilder: (context, index) {
var res = controller.driversWalletPoints[index];
if (res != null && res['name_arabic'] != null) {
return _buildWalletCard(res, cs);
}
return const SizedBox.shrink();
},
),
),
],
);
},
),
),
],
),
);
}
Widget _buildAppBar(BuildContext context, 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),
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: cs.primary.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.primary.withValues(alpha: 0.25)),
),
child: Icon(Icons.account_balance_wallet_rounded,
color: cs.primary, size: 18),
),
const SizedBox(width: 10),
Text(
'المحافظ المالية',
style: TextStyle(
color: cs.onSurface,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
const Spacer(),
GestureDetector(
onTap: () async {
walletAdminController.getWalletForEachDriverToPay();
},
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.refresh_rounded,
color: cs.onSurfaceVariant, size: 18),
),
),
],
),
);
}
Widget _buildLoadingState(ColorScheme cs) {
return const Center(child: MyCircularProgressIndicator());
}
Widget _buildEmptyState(ColorScheme cs) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
shape: BoxShape.circle,
),
child: Icon(Icons.account_balance_wallet_rounded,
size: 48, color: cs.onSurfaceVariant),
),
const SizedBox(height: 16),
Text('لا توجد محافظ مالية',
style: TextStyle(color: cs.onSurfaceVariant, fontSize: 14)),
],
),
);
}
Widget _buildPayAllButton(
BuildContext context, WalletAdminController controller, ColorScheme cs) {
return Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 8),
child: SizedBox(
width: double.infinity,
height: 48,
child: ElevatedButton.icon(
icon: const Icon(Icons.send_rounded, color: Colors.white, size: 18),
label: Text(
'دفع الجميع للبنوك',
style: const TextStyle(
color: Colors.white, fontWeight: FontWeight.bold, fontSize: 14),
),
style: ElevatedButton.styleFrom(
backgroundColor: cs.primary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(14)),
elevation: 0,
),
onPressed: () async {
await controller.payToBankDriverAll();
},
),
),
);
}
Widget _buildWalletCard(dynamic res, ColorScheme cs) {
final String name = res['name_arabic']?.toString() ?? 'بدون اسم';
final String amount = res['total_amount']?.toString() ?? '0';
return Container(
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: cs.outline),
),
child: Padding(
padding: const EdgeInsets.all(14),
child: Row(
children: [
Container(
width: 44,
height: 44,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
const Color(0xFF10B981).withValues(alpha: 0.20),
const Color(0xFF10B981).withValues(alpha: 0.08),
],
),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: const Color(0xFF10B981).withValues(alpha: 0.2)),
),
child: Icon(Icons.person_rounded, color: const Color(0xFF10B981), size: 22),
),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: TextStyle(
color: cs.onSurface,
fontWeight: FontWeight.w600,
fontSize: 14,
),
),
const SizedBox(height: 3),
Text(
'سائق',
style: TextStyle(
color: cs.onSurfaceVariant,
fontSize: 11,
),
),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
amount,
style: TextStyle(
color: const Color(0xFF10B981),
fontWeight: FontWeight.w800,
fontSize: 18,
),
),
Text(
'ل.س',
style: TextStyle(
color: const Color(0xFF10B981).withValues(alpha: 0.6),
fontSize: 10,
fontWeight: FontWeight.w500,
),
),
],
),
],
),
),
);
}
}