feat: phase 1 of improve

This commit is contained in:
2026-07-08 00:17:46 +03:30
parent 0bd2b4a18a
commit ffd2646eea
6 changed files with 461 additions and 135 deletions
@@ -87,7 +87,7 @@ class _LobbyScreenState extends State<LobbyScreen> {
icon: Icons.group_add,
label: 'دورهمی',
sub: 'بازی با دوستان',
accent: AppColors.lapis,
accent: AppColors.accent,
onTap: () async {
await context.push('/private');
if (context.mounted) _reload();
@@ -122,16 +122,18 @@ class _LobbyScreenState extends State<LobbyScreen> {
const SizedBox(height: 14),
_DailyCard(
wallet: wallet,
onTap: () => StreakDialog.show(
context,
streak: wallet?.dailyStreak ?? 0,
best: wallet?.bestStreak ?? 0,
ready: wallet?.dailyReady ?? true,
nextReward: wallet?.nextDaily ?? 200,
onClaim: () => context
.read<WalletBloc>()
.add(ClaimDailyEvent()),
),
onTap:
() => StreakDialog.show(
context,
streak: wallet?.dailyStreak ?? 0,
best: wallet?.bestStreak ?? 0,
ready: wallet?.dailyReady ?? true,
nextReward: wallet?.nextDaily ?? 200,
onClaim:
() => context.read<WalletBloc>().add(
ClaimDailyEvent(),
),
),
),
],
),
@@ -142,8 +144,11 @@ class _LobbyScreenState extends State<LobbyScreen> {
context.read<AuthBloc>().add(LogoutEvent());
context.go('/login');
},
icon: const Icon(Icons.logout,
color: Colors.white38, size: 18),
icon: const Icon(
Icons.logout,
color: Colors.white38,
size: 18,
),
label: const Text(
'خروج از حساب',
style: TextStyle(color: Colors.white38, fontSize: 13),
@@ -175,8 +180,10 @@ class _LobbyHeader extends StatelessWidget {
SizedBox(height: 4),
GlowText('حاکم ایرانی', size: 36),
SizedBox(height: 2),
Text('بازیِ آنلاینِ حکم',
style: TextStyle(color: Colors.white54, fontSize: 13)),
Text(
'بازیِ آنلاینِ حکم',
style: TextStyle(color: Colors.white54, fontSize: 13),
),
],
);
}
@@ -202,9 +209,14 @@ class _PrimaryPlay extends StatelessWidget {
border: Border.all(color: AppColors.gold, width: 2),
boxShadow: [
BoxShadow(
color: AppColors.gold.withValues(alpha: 0.28), blurRadius: 16),
color: AppColors.gold.withValues(alpha: 0.28),
blurRadius: 16,
),
const BoxShadow(
color: Colors.black54, blurRadius: 10, offset: Offset(0, 5)),
color: Colors.black54,
blurRadius: 10,
offset: Offset(0, 5),
),
],
),
child: Row(
@@ -213,30 +225,42 @@ class _PrimaryPlay extends StatelessWidget {
width: 54,
height: 54,
decoration: const BoxDecoration(
gradient:
LinearGradient(colors: [AppColors.gold, AppColors.goldDark]),
gradient: LinearGradient(
colors: [AppColors.gold, AppColors.goldDark],
),
shape: BoxShape.circle,
),
child:
const Icon(Icons.play_arrow_rounded, color: AppColors.lapisInk, size: 36),
child: const Icon(
Icons.play_arrow_rounded,
color: AppColors.lapisInk,
size: 36,
),
),
const SizedBox(width: 14),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text('بازی سریع',
style: TextStyle(
color: Colors.white,
fontSize: 22,
fontWeight: FontWeight.bold)),
Text(
'بازی سریع',
style: TextStyle(
color: Colors.white,
fontSize: 22,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 2),
Text('ورود به میزِ عمومی',
style: TextStyle(color: Colors.white70, fontSize: 13)),
Text(
'ورود به میزِ عمومی',
style: TextStyle(color: Colors.white70, fontSize: 13),
),
],
),
const Spacer(),
const Icon(Icons.arrow_back_ios_new,
color: AppColors.gold, size: 18),
const Icon(
Icons.arrow_forward_ios,
color: AppColors.gold,
size: 18,
),
],
),
),
@@ -295,15 +319,19 @@ class _ActionTile extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(label,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold)),
Text(
label,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 2),
Text(sub,
style:
const TextStyle(color: Colors.white54, fontSize: 11)),
Text(
sub,
style: const TextStyle(color: Colors.white54, fontSize: 11),
),
],
),
],
@@ -328,9 +356,10 @@ class _DailyCard extends StatelessWidget {
final ready = w?.dailyReady ?? true;
final next = w?.nextDaily ?? 200;
final colors = ready
? const [AppColors.success, AppColors.successDark]
: const [AppColors.lapisHi, AppColors.lapisLo];
final colors =
ready
? const [AppColors.success, AppColors.successDark]
: const [AppColors.lapisHi, AppColors.lapisLo];
return Opacity(
opacity: ready ? 1 : 0.75,
@@ -353,17 +382,23 @@ class _DailyCard extends StatelessWidget {
Stack(
alignment: Alignment.center,
children: [
Icon(Icons.local_fire_department,
color: streak > 0 ? const Color(0xFFFF7A1A) : Colors.white54,
size: 40),
Icon(
Icons.local_fire_department,
color:
streak > 0 ? const Color(0xFFFF7A1A) : Colors.white54,
size: 40,
),
if (streak > 0)
Padding(
padding: const EdgeInsets.only(top: 6),
child: Text('$streak',
style: const TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold)),
child: Text(
'$streak',
style: const TextStyle(
color: Colors.white,
fontSize: 13,
fontWeight: FontWeight.bold,
),
),
),
],
),
@@ -371,14 +406,22 @@ class _DailyCard extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('هدیه‌ی روزانه',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold)),
const Text(
'هدیه‌ی روزانه',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
Text(
streak > 0 ? '$streak روز پیاپی 🔥' : 'زنجیره‌ات رو شروع کن!',
style: const TextStyle(color: Colors.white70, fontSize: 12),
streak > 0
? '$streak روز پیاپی 🔥'
: 'زنجیره‌ات رو شروع کن!',
style: const TextStyle(
color: Colors.white70,
fontSize: 12,
),
),
],
),
@@ -387,26 +430,42 @@ class _DailyCard extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(mainAxisSize: MainAxisSize.min, children: [
const Icon(Icons.monetization_on,
color: AppColors.gold, size: 16),
const SizedBox(width: 3),
Text('+$next',
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
Icons.monetization_on,
color: AppColors.gold,
size: 16,
),
const SizedBox(width: 3),
Text(
'+$next',
style: const TextStyle(
color: AppColors.gold,
fontWeight: FontWeight.bold)),
]),
const Text('دریافت',
style: TextStyle(color: Colors.white70, fontSize: 11)),
color: AppColors.gold,
fontWeight: FontWeight.bold,
),
),
],
),
const Text(
'دریافت',
style: TextStyle(color: Colors.white70, fontSize: 11),
),
],
)
else
const Row(mainAxisSize: MainAxisSize.min, children: [
Icon(Icons.check_circle, color: AppColors.gold, size: 18),
SizedBox(width: 4),
Text('امروز گرفتی',
style: TextStyle(color: Colors.white70, fontSize: 12)),
]),
const Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.check_circle, color: AppColors.gold, size: 18),
SizedBox(width: 4),
Text(
'امروز گرفتی',
style: TextStyle(color: Colors.white70, fontSize: 12),
),
],
),
],
),
),