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

This commit is contained in:
Hamza-Ayed
2026-07-26 13:15:45 +03:00
parent 4b5235c35c
commit 330dfc6dba
9 changed files with 1025 additions and 61 deletions
@@ -204,11 +204,6 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
late final RidesListController controller;
late TabController _tabController;
// 🎨 الألوان العصرية
final Color bgColor = const Color(0xFFF4F7FE);
final Color primaryColor = const Color(0xFF4318FF);
final Color textPrimary = const Color(0xFF2B3674);
@override
void initState() {
super.initState();
@@ -232,10 +227,11 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return Scaffold(
backgroundColor: bgColor,
backgroundColor: cs.surface,
body: SafeArea(
top: false, // نسمح للـ AppBar بالتمدد لأعلى الشاشة
top: false,
child: CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
@@ -243,16 +239,16 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
SliverAppBar(
pinned: true,
floating: false,
expandedHeight: 310.0, // ارتفاع الجزء العلوي بالكامل
backgroundColor: primaryColor,
expandedHeight: 310.0,
backgroundColor: cs.primary,
elevation: 4,
shadowColor: primaryColor.withOpacity(0.4),
iconTheme: const IconThemeData(color: Colors.white),
shadowColor: cs.primary.withValues(alpha: 0.4),
iconTheme: IconThemeData(color: cs.onPrimary),
centerTitle: true,
title: const Text(
title: Text(
'إدارة الرحلات',
style: TextStyle(
color: Colors.white,
color: cs.onPrimary,
fontWeight: FontWeight.bold,
fontSize: 20,
),
@@ -263,16 +259,16 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 14),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
color: cs.onPrimary.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(12),
),
alignment: Alignment.center,
child: const Text(
child: Text(
'اليوم',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.white,
color: cs.onPrimary,
),
),
),
@@ -281,7 +277,10 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
background: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [primaryColor, primaryColor.withOpacity(0.8)],
colors: [
cs.primary,
cs.primary.withValues(alpha: 0.8),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
@@ -290,12 +289,12 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
mainAxisAlignment: MainAxisAlignment.end,
children: [
// الإحصائيات تختفي عند التمرير لأعلى
_buildStatisticsSection(),
_buildStatisticsSection(cs),
const SizedBox(height: 12),
// شريط البحث يختفي عند التمرير لأعلى
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: _buildSearchBar(),
child: _buildSearchBar(cs),
),
const SizedBox(height: 60), // مساحة للـ TabBar بالأسفل
],
@@ -306,18 +305,17 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
bottom: PreferredSize(
preferredSize: const Size.fromHeight(54),
child: Container(
decoration: const BoxDecoration(
color:
Color(0xFFF4F7FE), // لون خلفية التطبيق ليظهر بشكل مدمج
decoration: BoxDecoration(
color: cs.surface,
borderRadius:
BorderRadius.vertical(top: Radius.circular(24)),
const BorderRadius.vertical(top: Radius.circular(24)),
),
child: TabBar(
controller: _tabController,
isScrollable: true,
labelColor: primaryColor,
unselectedLabelColor: Colors.grey,
indicatorColor: primaryColor,
labelColor: cs.primary,
unselectedLabelColor: cs.onSurfaceVariant,
indicatorColor: cs.primary,
indicatorWeight: 3,
labelStyle: const TextStyle(
fontWeight: FontWeight.bold, fontSize: 14),
@@ -359,13 +357,13 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.inbox_rounded,
size: 80, color: Colors.grey[400]),
size: 80, color: cs.onSurfaceVariant),
const SizedBox(height: 16),
Text(
'لا توجد رحلات في هذا القسم',
style: TextStyle(
fontSize: 16,
color: Colors.grey[600],
color: cs.onSurfaceVariant,
fontWeight: FontWeight.w600,
),
),
@@ -380,7 +378,7 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
(context, index) {
final ride = controller.displayedRides[index];
return _buildRideCardCompact(
ride, controller.isSuperAdmin);
ride, controller.isSuperAdmin, cs);
},
childCount: controller.displayedRides.length,
),
@@ -395,7 +393,7 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
// --- Components ---
Widget _buildStatisticsSection() {
Widget _buildStatisticsSection(ColorScheme cs) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -446,17 +444,17 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
}
Widget _buildStatCard(
String label, String value, IconData icon, Color iconColor) {
String label, String value, IconData icon, Color iconColor, ColorScheme cs) {
return Container(
width: 105,
margin: const EdgeInsets.only(left: 10),
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
decoration: BoxDecoration(
color: Colors.white,
color: cs.surface,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
color: cs.shadow.withValues(alpha: 0.1),
blurRadius: 10,
offset: const Offset(0, 4),
)
@@ -470,7 +468,7 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
Text(
value,
style: TextStyle(
fontSize: 18, fontWeight: FontWeight.bold, color: textPrimary),
fontSize: 18, fontWeight: FontWeight.bold, color: cs.onSurface),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -479,7 +477,7 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
label,
style: TextStyle(
fontSize: 11,
color: Colors.grey[600],
color: cs.onSurfaceVariant,
fontWeight: FontWeight.bold),
),
],
@@ -487,7 +485,7 @@ class _RidesDashboardScreenState extends State<RidesDashboardScreen>
);
}
Widget _buildSearchBar() {
Widget _buildSearchBar(ColorScheme cs) {
return Container(
decoration: BoxDecoration(
color: Colors.white,