Files
intaleq/intaleq_driver/lib/views/widgets/driver_earnings_badge.dart
T
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

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,
),
),
),
],
),
),
);
}
}