إصلاح أخطاء شاشة الكباتن من تحديث الذكاء الاصطناعي

This commit is contained in:
Hamza-Ayed
2026-07-26 13:44:07 +03:00
parent 330dfc6dba
commit e269cb9b70
21 changed files with 72156 additions and 71654 deletions
@@ -18,71 +18,93 @@ class LiveAnalyticsPage extends StatelessWidget {
length: 4,
child: Scaffold(
backgroundColor: cs.surface,
appBar: AppBar(
title: const Text('لوحة البيانات التفاعلية',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
backgroundColor: cs.surfaceContainerHighest,
elevation: 0,
centerTitle: true,
actions: [
IconButton(
icon: const Icon(Icons.calendar_month_rounded, size: 22),
onPressed: () => _pickDate(context, c),
body: Column(
children: [
Container(
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
child: Row(
children: [
GestureDetector(
onTap: () => Get.back(),
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.outline),
),
child: Icon(Icons.arrow_back_ios_new_rounded, color: cs.onSurfaceVariant, size: 16),
),
),
const SizedBox(width: 12),
Text('لوحة البيانات التفاعلية', style: TextStyle(color: cs.onSurface, fontSize: 18, fontWeight: FontWeight.w700)),
const Spacer(),
IconButton(
icon: const Icon(Icons.calendar_month_rounded, size: 22),
onPressed: () => _pickDate(context, c),
),
IconButton(
icon: const Icon(Icons.refresh_rounded, size: 22),
onPressed: () => c.fetchAll(),
),
],
),
),
IconButton(
icon: const Icon(Icons.refresh_rounded, size: 22),
onPressed: () => c.fetchAll(),
Container(
color: cs.surface,
child: TabBar(
isScrollable: true,
indicatorColor: cs.primary,
labelColor: cs.primary,
unselectedLabelColor: cs.onSurfaceVariant,
labelStyle: const TextStyle(fontWeight: FontWeight.w600, fontSize: 13),
tabs: const [
Tab(text: 'الخريطة التفاعلية', icon: Icon(Icons.map_rounded, size: 18)),
Tab(text: 'السوق والتسعير', icon: Icon(Icons.trending_up_rounded, size: 18)),
Tab(text: 'الأسطول والجودة', icon: Icon(Icons.local_taxi_rounded, size: 18)),
Tab(text: 'النمو والاحتفاظ', icon: Icon(Icons.show_chart_rounded, size: 18)),
],
),
),
Expanded(
child: GetBuilder<LiveAnalyticsController>(
builder: (ctrl) {
if (ctrl.isLoading) {
return Center(
child: CircularProgressIndicator(color: cs.primary),
);
}
if (ctrl.allData.isEmpty) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.cloud_off_rounded,
size: 48, color: cs.onSurfaceVariant),
const SizedBox(height: 12),
Text('لا توجد بيانات لتاريخ ${ctrl.selectedDate}',
style: TextStyle(color: cs.onSurfaceVariant)),
const SizedBox(height: 8),
if (ctrl.availableDates.isNotEmpty)
Text('آخر تاريخ متاح: ${ctrl.availableDates.first}',
style: TextStyle(
color: cs.primary, fontSize: 13)),
],
),
);
}
return TabBarView(
children: [
_MapTab(ctrl: ctrl),
_MarketTab(ctrl: ctrl),
_FleetTab(ctrl: ctrl),
_GrowthTab(ctrl: ctrl),
],
);
},
),
),
],
bottom: TabBar(
isScrollable: true,
indicatorColor: cs.primary,
labelColor: cs.primary,
unselectedLabelColor: cs.onSurfaceVariant,
labelStyle: const TextStyle(fontWeight: FontWeight.w600, fontSize: 13),
tabs: const [
Tab(text: 'الخريطة التفاعلية', icon: Icon(Icons.map_rounded, size: 18)),
Tab(text: 'السوق والتسعير', icon: Icon(Icons.trending_up_rounded, size: 18)),
Tab(text: 'الأسطول والجودة', icon: Icon(Icons.local_taxi_rounded, size: 18)),
Tab(text: 'النمو والاحتفاظ', icon: Icon(Icons.show_chart_rounded, size: 18)),
],
),
),
body: GetBuilder<LiveAnalyticsController>(
builder: (ctrl) {
if (ctrl.isLoading) {
return Center(
child: CircularProgressIndicator(color: cs.primary),
);
}
if (ctrl.allData.isEmpty) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.cloud_off_rounded,
size: 48, color: cs.onSurfaceVariant),
const SizedBox(height: 12),
Text('لا توجد بيانات لتاريخ ${ctrl.selectedDate}',
style: TextStyle(color: cs.onSurfaceVariant)),
const SizedBox(height: 8),
if (ctrl.availableDates.isNotEmpty)
Text('آخر تاريخ متاح: ${ctrl.availableDates.first}',
style: TextStyle(
color: cs.primary, fontSize: 13)),
],
),
);
}
return TabBarView(
children: [
_MapTab(ctrl: ctrl),
_MarketTab(ctrl: ctrl),
_FleetTab(ctrl: ctrl),
_GrowthTab(ctrl: ctrl),
],
);
},
),
),
);