Files
tripz-llc/apps/driver/lib/views/widgets/driver_earnings_badge.dart
T
Hamza-AyedandClaude Opus 5 4d8414c96b feat: استيراد كود سيرو إلى تريبز (سيرو @ecfe7568) — بلا تعديل
قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة
ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ.

الخريطة:
  backend · payment_server · loction_server · ride_server ·
  passenger_server · docker · dashboard · stress_test  → الجذر
  siro_rider  → apps/rider          siro_driver  → apps/driver
  siro_admin  → dashboards/admin    siro_service → dashboards/service
  android_bot → apps/android_bot    socialBot    → apps/socialBot

نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب)
لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً:
كل ما يلي يصير فرقاً مقروءاً مقابل المصدر.

لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز،
سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh
(ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في
مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و
dashboards/transit-web).

⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة:
1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر):
   كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner.
2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist)
   يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً.
3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع →
   يجب ضمّ الحزم داخله أسوة بـ apps/rider.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:14:13 +03:00

102 lines
3.4 KiB
Dart

import 'package:flutter/material.dart';
/// DriverEarningsBadge
/// ─────────────────────
/// ويدجت يعرض للسائق مقارنة أرباحه مع سيرو مقارنةً بالمنافسين.
/// يُستخدم في شاشة قبول الطلب ليحفّز السائق على القبول.
class DriverEarningsBadge extends StatelessWidget {
/// النص الكامل الجاهز من السيرفر
final String? earningsLabel;
/// المبلغ الإضافي الذي يكسبه السائق (موجب = أكثر مع سيرو)
final double? extraAmount;
/// رمز العملة
final String currency;
const DriverEarningsBadge({
super.key,
this.earningsLabel,
this.extraAmount,
this.currency = 'ل.س',
});
@override
Widget build(BuildContext context) {
if (earningsLabel == null || earningsLabel!.isEmpty) {
return const SizedBox.shrink();
}
final double extra = extraAmount ?? 0;
final bool isPositive = extra >= 0;
return AnimatedOpacity(
opacity: 1.0,
duration: const Duration(milliseconds: 350),
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: isPositive
? [const Color(0xFF064E3B), const Color(0xFF065F46)]
: [const Color(0xFF1E1B4B), const Color(0xFF312E81)],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: isPositive
? const Color(0xFF10B981).withOpacity(0.4)
: const Color(0xFF818CF8).withOpacity(0.4),
),
),
child: Row(
children: [
Icon(
isPositive ? Icons.attach_money_rounded : Icons.info_outline_rounded,
color: isPositive
? const Color(0xFF34D399)
: const Color(0xFFA5B4FC),
size: 22,
),
const SizedBox(width: 10),
Expanded(
child: Text(
earningsLabel!,
style: TextStyle(
color: isPositive
? const Color(0xFF34D399)
: const Color(0xFFA5B4FC),
fontSize: 11.5,
fontWeight: FontWeight.w700,
height: 1.4,
),
),
),
if (extra > 0)
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: const Color(0xFF10B981).withOpacity(0.15),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: const Color(0xFF10B981).withOpacity(0.3),
),
),
child: Text(
'+${extra.toStringAsFixed(2)} $currency',
style: const TextStyle(
color: Color(0xFF34D399),
fontSize: 11,
fontWeight: FontWeight.w800,
),
),
),
],
),
),
);
}
}