إصلاح أخطاء شاشة الكباتن من تحديث الذكاء الاصطناعي
This commit is contained in:
@@ -17,50 +17,66 @@ class PromoManagementPage extends StatelessWidget {
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: cs.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: cs.surface,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: Text('إدارة أكواد الخصم'.tr, style: GoogleFonts.inter(fontWeight: FontWeight.w600, color: cs.onSurface)),
|
||||
leading: GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: Icon(Icons.arrow_back_ios_new_rounded, color: cs.onSurface),
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle_outline_rounded, color: cs.primary),
|
||||
onPressed: () => _showPromoSheet(context),
|
||||
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('إدارة أكواد الخصم'.tr, style: TextStyle(color: cs.onSurface, fontSize: 18, fontWeight: FontWeight.w700)),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle_outline_rounded, color: cs.primary),
|
||||
onPressed: () => _showPromoSheet(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Obx(() => controller.isLoading.value && controller.promoList.isEmpty
|
||||
? Center(child: CircularProgressIndicator(color: cs.primary))
|
||||
: controller.promoList.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(shape: BoxShape.circle, color: cs.onSurfaceVariant.withValues(alpha: 0.1)),
|
||||
child: Icon(Icons.confirmation_number_outlined, size: 48, color: cs.onSurfaceVariant),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text('لا يوجد أكواد خصم حالياً', style: GoogleFonts.inter(color: cs.onSurfaceVariant, fontSize: 14)),
|
||||
],
|
||||
),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getPromos(),
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 80),
|
||||
itemCount: controller.promoList.length,
|
||||
itemBuilder: (context, index) {
|
||||
final promo = controller.promoList[index];
|
||||
return _buildPromoCard(context, promo);
|
||||
},
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Obx(() => controller.isLoading.value && controller.promoList.isEmpty
|
||||
? Center(child: CircularProgressIndicator(color: cs.primary))
|
||||
: controller.promoList.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(shape: BoxShape.circle, color: cs.onSurfaceVariant.withValues(alpha: 0.1)),
|
||||
child: Icon(Icons.confirmation_number_outlined, size: 48, color: cs.onSurfaceVariant),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text('لا يوجد أكواد خصم حالياً', style: GoogleFonts.inter(color: cs.onSurfaceVariant, fontSize: 14)),
|
||||
],
|
||||
),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getPromos(),
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 80),
|
||||
itemCount: controller.promoList.length,
|
||||
itemBuilder: (context, index) {
|
||||
final promo = controller.promoList[index];
|
||||
return _buildPromoCard(context, promo);
|
||||
},
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user