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
@@ -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(