Update: 2026-08-08 14:09:20

This commit is contained in:
Hamza-Ayed
2026-08-08 14:09:20 +03:00
parent c8e8e481a6
commit 8395436f23
14 changed files with 295 additions and 104 deletions
@@ -222,24 +222,34 @@ class _HomeAppBar extends StatelessWidget implements PreferredSizeWidget {
// ── Logo + App Name ──────────────────────
title: Padding(
padding: const EdgeInsets.only(left: 4),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
_LogoBadge(),
const SizedBox(width: 6),
Flexible(
child: Text(
AppInformation.appName.split(' ')[0].tr,
style: const TextStyle(
color: _Token.accent,
fontSize: 18,
fontWeight: FontWeight.w800,
letterSpacing: 0.5,
),
overflow: TextOverflow.ellipsis,
),
),
],
// ‏شارات الـ actions تلتهم عرض الـ AppBar فلا يبقى للعنوان أحياناً
// ‏سوى ~26px، بينما الشعار وحده 36px — ومن هنا كان الفيض.
// ‏نُسقط الاسم عند ضيق المساحة ونُبقي الشعار: هو الهوية الأهم.
child: LayoutBuilder(
builder: (context, constraints) {
final showName = constraints.maxWidth >= 96;
return Row(
mainAxisSize: MainAxisSize.min,
children: [
_LogoBadge(),
if (showName) ...[
const SizedBox(width: 6),
Flexible(
child: Text(
AppInformation.appName.split(' ')[0].tr,
style: const TextStyle(
color: _Token.accent,
fontSize: 18,
fontWeight: FontWeight.w800,
letterSpacing: 0.5,
),
overflow: TextOverflow.ellipsis,
),
),
],
],
);
},
),
),
actions: [
@@ -140,14 +140,39 @@ class DriverInsurancePage extends StatelessWidget {
// ── الخطط المتاحة ──────────────────────────────────────────
List<Widget> _plansView(BuildContext context, DriverInsuranceController c) {
if (c.plans.isEmpty) {
// ‏الصفحة كانت تبدو "معطّلة" لأنها تعرض عنواناً واحداً بلا سبب.
// ‏الحالة الحقيقية: لا خطط مُفعّلة بعد لدى الشركاء — لا خطأ ولا
// ‏نقص أهلية — ونقولها صراحة حتى لا يظن الكابتن أن التطبيق خربان.
return [
const SizedBox(height: 80),
const SizedBox(height: 72),
Icon(Icons.health_and_safety_outlined,
size: 80, color: Colors.grey.shade400),
const SizedBox(height: 16),
Text('No insurance plans available yet'.tr,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 18, color: Colors.grey)),
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: Colors.grey)),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Insurance plans have not been launched in your area yet. Once a partner plan is available it will appear here automatically.'
.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14, height: 1.5, color: Colors.grey.shade600),
),
),
const SizedBox(height: 20),
Center(
child: TextButton.icon(
onPressed: c.isLoading.value ? null : () => c.refreshAll(),
icon: const Icon(Icons.refresh_rounded, size: 18),
label: Text('Refresh'.tr),
),
),
];
}
@@ -20,6 +20,44 @@ class DriverScheduledRidesPage extends StatelessWidget {
return const Center(child: CircularProgressIndicator());
}
// ‏تعذّر الجلب: نقولها بدل ادّعاء "لا حجوزات" — الفرق بينهما
// ‏هو الفرق بين كابتن يطمئن وكابتن يفوته عمل مؤكد.
if (controller.hasError.value) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.cloud_off_rounded,
size: 80, color: Colors.grey.shade400),
const SizedBox(height: 16),
Text(
'Could not load scheduled rides'.tr,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: Colors.grey),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Text(
'Please check your connection and try again.'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14, color: Colors.grey.shade600, height: 1.5),
),
),
const SizedBox(height: 16),
ElevatedButton.icon(
onPressed: controller.fetch,
icon: const Icon(Icons.refresh_rounded, size: 18),
label: Text('Retry'.tr),
),
],
),
);
}
if (controller.bookings.isEmpty) {
return Center(
child: Column(
@@ -18,7 +18,9 @@ class StatSummaryCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(16),
// ‏رأسي 12 لا 16: البطاقة داخل شبكة بارتفاع ثابت، و16 كانت تتجاوزه
// ‏بنحو 10px مع خط الرقم مقاس 22.
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: FinanceDesignSystem.cardColor,
borderRadius: BorderRadius.circular(FinanceDesignSystem.cardRadius),
@@ -54,14 +56,22 @@ class StatSummaryCard extends StatelessWidget {
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
value,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w900,
color: FinanceDesignSystem.primaryDark,
fontFamily: 'digit',
// ‏الرقم يتقلّص بدل أن يفيض: مبالغ الأرباح تطول بلا سقف
// ‏(٤ خانات + كسور + عملة) والبطاقة عرضها ثابت.
FittedBox(
fit: BoxFit.scaleDown,
alignment: AlignmentDirectional.centerStart,
child: Text(
value,
maxLines: 1,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w900,
color: FinanceDesignSystem.primaryDark,
fontFamily: 'digit',
),
),
),
Text(