Update: 2026-08-02 22:51:18

This commit is contained in:
Hamza-Ayed
2026-08-02 22:51:18 +03:00
parent c9af364cbc
commit 2c962bf80a
39 changed files with 627 additions and 191 deletions
@@ -1,3 +1,4 @@
import 'package:siro_admin/constant/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:get/get.dart';
@@ -211,7 +212,7 @@ class MarketingPage extends StatelessWidget {
const SizedBox(height: 12),
Row(
children: [
_buildStatItem('سعرنا', '${anomaly['our_price']}', const Color(0xFF10B981), cs),
_buildStatItem('سعرنا', '${anomaly['our_price']}', cs.success, cs),
const SizedBox(width: 24),
_buildStatItem('سعر المنافس', '${anomaly['competitor_price']}', cs.error, cs),
const SizedBox(width: 24),
@@ -441,7 +442,7 @@ class MarketingPage extends StatelessWidget {
child: Text(region['name'] as String, style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold, color: cs.onSurface)),
),
const SizedBox(width: 8),
Text(region['desc'] as String, style: TextStyle(fontSize: 10, color: (region['pci'] as double) < 1 ? const Color(0xFF10B981) : cs.error)),
Text(region['desc'] as String, style: TextStyle(fontSize: 10, color: (region['pci'] as double) < 1 ? cs.success : cs.error)),
],
),
const SizedBox(height: 6),
@@ -449,8 +450,8 @@ class MarketingPage extends StatelessWidget {
borderRadius: BorderRadius.circular(4),
child: LinearProgressIndicator(
value: ((region['weight'] as double) + 1) / 2,
backgroundColor: const Color(0xFF10B981).withValues(alpha: 0.3),
color: (region['pci'] as double) < 1 ? const Color(0xFF10B981) : cs.error,
backgroundColor: cs.success.withValues(alpha: 0.3),
color: (region['pci'] as double) < 1 ? cs.success : cs.error,
minHeight: 6,
),
),
@@ -518,7 +519,7 @@ class MarketingPage extends StatelessWidget {
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: c.simulatorRecommendationStatus == 'success' ? const Color(0xFF10B981).withValues(alpha: 0.1) : (c.simulatorRecommendationStatus == 'danger' ? cs.error.withValues(alpha: 0.1) : cs.tertiary.withValues(alpha: 0.1)),
color: c.simulatorRecommendationStatus == 'success' ? cs.success.withValues(alpha: 0.1) : (c.simulatorRecommendationStatus == 'danger' ? cs.error.withValues(alpha: 0.1) : cs.tertiary.withValues(alpha: 0.1)),
borderRadius: BorderRadius.circular(8),
),
child: Column(
@@ -544,7 +545,7 @@ class MarketingPage extends StatelessWidget {
c.simulatorRecommendationMessage ?? '',
style: TextStyle(
fontSize: 11,
color: c.simulatorRecommendationStatus == 'success' ? const Color(0xFF10B981) : (c.simulatorRecommendationStatus == 'danger' ? cs.error : cs.tertiary)
color: c.simulatorRecommendationStatus == 'success' ? cs.success : (c.simulatorRecommendationStatus == 'danger' ? cs.error : cs.tertiary)
),
),
],
@@ -570,7 +571,7 @@ class MarketingPage extends StatelessWidget {
final channel = log['channel']?.toString().toUpperCase() ?? 'SMS';
Color channelColor = cs.tertiary;
if (channel == 'SMS') channelColor = const Color(0xFF10B981);
if (channel == 'SMS') channelColor = cs.success;
if (channel == 'WHATSAPP') channelColor = const Color(0xFF25D366);
return Card(
@@ -689,7 +690,7 @@ class MarketingPage extends StatelessWidget {
children: [
_buildTelemetryItem('طلبات الـ API', '${c.apiRequestsCount}', cs.onSurface, cs),
_buildTelemetryItem('الرموز (Tokens)', '${c.totalTokensUsed}', cs.onSurface, cs),
_buildTelemetryItem('التكلفة التقديرية', '\$${c.estimatedCostUSD.toStringAsFixed(5)}', const Color(0xFF10B981), cs),
_buildTelemetryItem('التكلفة التقديرية', '\$${c.estimatedCostUSD.toStringAsFixed(5)}', cs.success, cs),
],
),
],