chore: استيراد أولي من سيرو (ecfe7568) — بلا أي تعديل
نسخة كاملة من مستودع سيرو عند ecfe7568 لتكون أساس تطبيق «انطلق». نُسخ المتعقَّب في git فقط (12,509 ملفاً / 302 م.ب) بـ git archive، لا `cp -r` — فاستُثنيت تلقائياً مخلفات البناء (build · node_modules · .dart_tool · .gradle · Pods ≈ 10.7 غ.ب) وكل ما يستثنيه .gitignore. هذا الكوميت **بلا أي تعديل عمداً** حتى يكون كل ما يليه فرقاً مقروءاً مقابل سيرو الأصلي. سيرو نفسه لم يُمسّ. ⚠️ لا يبني بعد: `.env` و`lib/env/env.g.dart` غير متعقَّبين في سيرو (وهذا صحيح — أسرار لكل مستأجر). كل تطبيق فلاتر هنا يحتاج .env خاصاً بانطلق ثم توليد env.g.dart عبر build_runner. لا تُنسخ أسرار سيرو. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user