add new featurs like new stat page

This commit is contained in:
Hamza-Ayed
2026-05-08 22:44:55 +03:00
parent efbc921273
commit 8f555691b9
33 changed files with 1194 additions and 585 deletions

View File

@@ -12,17 +12,18 @@ class ChallengesPage extends StatelessWidget {
return Scaffold(
backgroundColor: FinanceDesignSystem.backgroundColor,
body: GetBuilder<ChallengesController>(builder: (cc) {
if (cc.isLoading)
return const Center(
if (cc.isLoading) {
return Center(
child: CircularProgressIndicator(
color: FinanceDesignSystem.primaryDark));
}
return CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
SliverAppBar(
expandedHeight: 160,
pinned: true,
backgroundColor: const Color(0xFF1A237E),
backgroundColor: Get.isDarkMode ? FinanceDesignSystem.primaryDark : const Color(0xFF1A237E),
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded,
color: Colors.white, size: 20),
@@ -36,22 +37,22 @@ class ChallengesPage extends StatelessWidget {
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
title: Text('Challenges'.tr,
style: const TextStyle(
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18)),
background: Stack(fit: StackFit.expand, children: [
Container(
decoration: const BoxDecoration(
gradient: LinearGradient(colors: [
Color(0xFF0A0E21),
Color(0xFF1A237E)
]))),
decoration: BoxDecoration(
gradient: LinearGradient(colors: Get.isDarkMode
? [FinanceDesignSystem.primaryDark, const Color(0xFF1E1E2E)]
: [const Color(0xFF0A0E21), const Color(0xFF1A237E)]
))),
Positioned(
right: -30,
top: -10,
child: Icon(Icons.bolt_rounded,
size: 160, color: Colors.white.withOpacity(0.04))),
size: 160, color: Colors.white.withValues(alpha: 0.04))),
]),
),
),
@@ -92,10 +93,10 @@ class ChallengesPage extends StatelessWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: FinanceDesignSystem.accentBlue.withOpacity(0.1),
color: FinanceDesignSystem.accentBlue.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(20)),
child: Text('$done/$total',
style: const TextStyle(
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: FinanceDesignSystem.accentBlue)),
@@ -112,11 +113,11 @@ class ChallengesPage extends StatelessWidget {
color: Colors.white,
borderRadius: BorderRadius.circular(FinanceDesignSystem.cardRadius),
border: c.isCompleted
? Border.all(color: c.color.withOpacity(0.3), width: 1.5)
? Border.all(color: c.color.withValues(alpha: 0.3), width: 1.5)
: null,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.03),
color: Colors.black.withValues(alpha: 0.03),
blurRadius: 10,
offset: const Offset(0, 4))
],
@@ -127,7 +128,7 @@ class ChallengesPage extends StatelessWidget {
width: 44,
height: 44,
decoration: BoxDecoration(
color: c.color.withOpacity(0.12),
color: c.color.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(12)),
child: Icon(c.icon, color: c.color, size: 22),
),
@@ -143,12 +144,12 @@ class ChallengesPage extends StatelessWidget {
color: FinanceDesignSystem.primaryDark)),
Text(isAr ? c.descriptionAr : c.descriptionEn,
style:
TextStyle(fontSize: 11, color: Colors.grey.shade500)),
TextStyle(fontSize: 11, color: FinanceDesignSystem.textSecondary)),
])),
Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: const Color(0xFFFFD700).withOpacity(0.15),
color: const Color(0xFFFFD700).withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(12)),
child: Text('+${c.reward}',
style: const TextStyle(
@@ -164,7 +165,7 @@ class ChallengesPage extends StatelessWidget {
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Colors.grey.shade600)),
color: FinanceDesignSystem.textSecondary)),
Text('${(c.progress * 100).toStringAsFixed(0)}%',
style: TextStyle(
fontSize: 11, fontWeight: FontWeight.bold, color: c.color)),
@@ -174,7 +175,7 @@ class ChallengesPage extends StatelessWidget {
Container(
height: 8,
decoration: BoxDecoration(
color: Colors.grey.shade100,
color: FinanceDesignSystem.backgroundColor,
borderRadius: BorderRadius.circular(4))),
LayoutBuilder(
builder: (ctx, cons) => AnimatedContainer(
@@ -184,7 +185,7 @@ class ChallengesPage extends StatelessWidget {
width: cons.maxWidth * c.progress,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [c.color, c.color.withOpacity(0.6)]),
colors: [c.color, c.color.withValues(alpha: 0.6)]),
borderRadius: BorderRadius.circular(4),
),
)),
@@ -212,11 +213,11 @@ class ChallengesPage extends StatelessWidget {
const SizedBox(height: 8),
Center(
child: Row(mainAxisSize: MainAxisSize.min, children: [
const Icon(Icons.check_circle_rounded,
Icon(Icons.check_circle_rounded,
color: FinanceDesignSystem.successGreen, size: 16),
const SizedBox(width: 4),
Text('Claimed'.tr,
style: const TextStyle(
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: FinanceDesignSystem.successGreen)),