diff --git a/lib/feature/game/domain/entities/table_entities.dart b/lib/feature/game/domain/entities/table_entities.dart index af96613..e8a7e16 100644 --- a/lib/feature/game/domain/entities/table_entities.dart +++ b/lib/feature/game/domain/entities/table_entities.dart @@ -7,6 +7,7 @@ class TableTier { final int prize; final int xp; final int trophy; + final int rankReward; // > 0 ⇒ میزِ رتبه‌بندی (به برنده امتیازِ رتبه می‌دهد) const TableTier({ required this.id, @@ -16,8 +17,12 @@ class TableTier { required this.prize, required this.xp, required this.trophy, + this.rankReward = 0, }); + /// آیا این میزِ رتبه‌بندی است؟ (برد امتیازِ رتبه می‌دهد و در جدولِ قهرمانان بالا می‌برد) + bool get isRanked => rankReward > 0; + factory TableTier.fromJson(Map j) => TableTier( id: j['id'] as String, title: j['title'] as String, @@ -26,6 +31,7 @@ class TableTier { prize: (j['prize'] ?? 0) as int, xp: (j['xp'] ?? 0) as int, trophy: (j['trophy'] ?? 0) as int, + rankReward: (j['rank_reward'] ?? 0) as int, ); } diff --git a/lib/feature/game/presentation/screen/tier_list_screen.dart b/lib/feature/game/presentation/screen/tier_list_screen.dart index 4be0933..5b2d332 100644 --- a/lib/feature/game/presentation/screen/tier_list_screen.dart +++ b/lib/feature/game/presentation/screen/tier_list_screen.dart @@ -78,6 +78,7 @@ class _TierCard extends StatelessWidget { @override Widget build(BuildContext context) { + if (tier.isRanked) return _rankedCard(context); final colors = _palettes[index % _palettes.length]; return GestureDetector( onTap: () => context.push('/game/${tier.id}?prize=${tier.prize}'), @@ -143,6 +144,156 @@ class _TierCard extends StatelessWidget { ); } + // میزِ رتبه‌بندی: طرحِ ویژه‌ی سلطنتی (تاج، درخششِ طلایی، توضیح) تا از میزهای + // معمولی متمایز باشد و کاربر بداند این میز چه‌کاری می‌کند. + Widget _rankedCard(BuildContext context) { + return GestureDetector( + onTap: () => context.push('/game/${tier.id}?prize=${tier.prize}'), + child: Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + gradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [Color(0xFF3A2A6E), Color(0xFF15193F), AppColors.lapisInk], + ), + borderRadius: BorderRadius.circular(18), + border: Border.all(color: AppColors.gold, width: 2.4), + boxShadow: [ + BoxShadow( + color: AppColors.gold.withValues(alpha: 0.32), blurRadius: 16), + const BoxShadow( + color: Colors.black54, blurRadius: 10, offset: Offset(0, 5)), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(9), + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [AppColors.gold, AppColors.goldDark]), + shape: BoxShape.circle, + ), + child: const Icon(Icons.workspace_premium, + color: AppColors.lapisInk, size: 24), + ), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + Flexible( + child: Text(tier.title, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + color: AppColors.gold, + fontSize: 21, + fontWeight: FontWeight.bold, + shadows: [ + Shadow(color: Colors.black54, blurRadius: 3) + ], + )), + ), + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 7, vertical: 2), + decoration: BoxDecoration( + color: AppColors.accent, + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: Colors.white.withValues(alpha: 0.3)), + ), + child: const Text('ویژه', + style: TextStyle( + color: Colors.white, + fontSize: 10, + fontWeight: FontWeight.bold)), + ), + ]), + const SizedBox(height: 2), + const Text('میزِ قهرمانان', + style: + TextStyle(color: Colors.white70, fontSize: 12)), + ], + ), + ), + Container( + padding: + const EdgeInsets.symmetric(horizontal: 10, vertical: 6), + decoration: BoxDecoration( + color: AppColors.gold.withValues(alpha: 0.14), + borderRadius: BorderRadius.circular(10), + border: Border.all(color: AppColors.gold), + ), + child: Column(children: [ + Row(mainAxisSize: MainAxisSize.min, children: [ + const Icon(Icons.military_tech, + color: AppColors.gold, size: 16), + const SizedBox(width: 3), + Text('+${tier.rankReward}', + style: const TextStyle( + color: AppColors.gold, + fontSize: 16, + fontWeight: FontWeight.bold)), + ]), + const Text('امتیاز رتبه', + style: TextStyle(color: Colors.white70, fontSize: 10)), + ]), + ), + ], + ), + const SizedBox(height: 12), + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10), + decoration: BoxDecoration( + color: Colors.black.withValues(alpha: 0.25), + borderRadius: BorderRadius.circular(10), + border: Border.all(color: AppColors.goldFaint), + ), + child: const Text( + 'با هر برد در این میز امتیازِ رتبه می‌گیرید و در جدولِ قهرمانان بالا می‌روید. ' + 'باخت امتیاز کم می‌کند — رقابتِ واقعی برای حرفه‌ای‌ها!', + style: TextStyle( + color: Colors.white, fontSize: 12.5, height: 1.6), + ), + ), + const SizedBox(height: 12), + Row(children: [ + _chip(Icons.style, '${tier.hands} دست'), + const SizedBox(width: 8), + _chip(Icons.login, 'ورودی ${tier.entry}'), + const SizedBox(width: 8), + _chip(Icons.star, 'XP ${tier.xp}'), + ]), + ], + ), + ), + ); + } + + Widget _chip(IconData icon, String text) => Container( + padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 5), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.08), + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.white.withValues(alpha: 0.14)), + ), + child: Row(mainAxisSize: MainAxisSize.min, children: [ + Icon(icon, size: 14, color: AppColors.gold), + const SizedBox(width: 5), + Text(text, + style: const TextStyle(color: Colors.white, fontSize: 12)), + ]), + ); + Widget _stat(IconData icon, String label, int value) => Padding( padding: const EdgeInsets.symmetric(vertical: 2), child: Row(mainAxisSize: MainAxisSize.min, children: [