feat: cleaning code
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:random_avatar/random_avatar.dart';
|
||||
|
||||
import '../../../../core/network/ws_client.dart';
|
||||
import '../../../../core/theme/app_theme.dart';
|
||||
import '../../domain/entities/game_entities.dart';
|
||||
|
||||
/// اوورلیِ روی صحنهی Flame: آواتارِ بازیکنان با قابِ طلایی، نام، نشانِ رتبه،
|
||||
@@ -105,7 +106,7 @@ class TableHud extends StatelessWidget {
|
||||
width: 1,
|
||||
height: 30,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 12),
|
||||
color: const Color(0x33E9B949),
|
||||
color: AppColors.goldFaint,
|
||||
),
|
||||
_scoreCol('حریف', opp),
|
||||
],
|
||||
@@ -121,7 +122,7 @@ class TableHud extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(color: Color(0xFFE9B949), fontSize: 12),
|
||||
style: const TextStyle(color: AppColors.gold, fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
'$v',
|
||||
@@ -135,7 +136,7 @@ class TableHud extends StatelessWidget {
|
||||
);
|
||||
|
||||
Widget _hokmChip() {
|
||||
final (glyph, color) = _trumpGlyph(s.trump);
|
||||
final (glyph, color) = suitGlyph(s.trump);
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
|
||||
decoration: _panelDeco(),
|
||||
@@ -145,7 +146,7 @@ class TableHud extends StatelessWidget {
|
||||
const Text(
|
||||
'حکم',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFE9B949),
|
||||
color: AppColors.gold,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -168,14 +169,14 @@ class TableHud extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
ok ? Icons.wifi : Icons.wifi_off,
|
||||
color: ok ? const Color(0xFF4CD964) : Colors.redAccent,
|
||||
color: ok ? AppColors.online : Colors.redAccent,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
ok ? 'آنلاین' : 'قطع',
|
||||
style: TextStyle(
|
||||
color: ok ? const Color(0xFF4CD964) : Colors.redAccent,
|
||||
color: ok ? AppColors.online : Colors.redAccent,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -186,7 +187,7 @@ class TableHud extends StatelessWidget {
|
||||
const SizedBox(width: 8),
|
||||
_RoundBtn(
|
||||
icon: Icons.logout,
|
||||
color: const Color(0xFFB81D2A),
|
||||
color: AppColors.accent,
|
||||
onTap: onExit,
|
||||
size: 40,
|
||||
),
|
||||
@@ -201,24 +202,9 @@ class TableHud extends StatelessWidget {
|
||||
colors: [Color(0xFF2A2018), Color(0xFF14100B)],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(color: const Color(0xFFB8860B), width: 1.4),
|
||||
border: Border.all(color: AppColors.goldDark, width: 1.4),
|
||||
boxShadow: const [BoxShadow(color: Colors.black54, blurRadius: 6)],
|
||||
);
|
||||
|
||||
(String, Color) _trumpGlyph(String? suit) {
|
||||
switch (suit) {
|
||||
case 'hearts':
|
||||
return ('♥', const Color(0xFFE53935));
|
||||
case 'diamonds':
|
||||
return ('♦', const Color(0xFFE53935));
|
||||
case 'clubs':
|
||||
return ('♣', Colors.white);
|
||||
case 'spades':
|
||||
return ('♠', Colors.white);
|
||||
default:
|
||||
return ('—', Colors.white54);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _PlayerSeat extends StatelessWidget {
|
||||
@@ -256,7 +242,7 @@ class _PlayerSeat extends StatelessWidget {
|
||||
color: const Color(0xCC14100B),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: isTurn ? const Color(0xFFE9B949) : const Color(0x55B8860B),
|
||||
color: isTurn ? AppColors.gold : const Color(0x55B8860B),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
@@ -265,7 +251,7 @@ class _PlayerSeat extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: isTurn ? const Color(0xFFE9B949) : Colors.white,
|
||||
color: isTurn ? AppColors.gold : Colors.white,
|
||||
fontSize: diameter * 0.18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -288,7 +274,7 @@ class _PlayerSeat extends StatelessWidget {
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Color(0xFFF3D27A), Color(0xFFB8860B)],
|
||||
colors: [Color(0xFFF3D27A), AppColors.goldDark],
|
||||
),
|
||||
boxShadow: const [
|
||||
BoxShadow(color: Colors.black54, blurRadius: 6),
|
||||
@@ -359,7 +345,7 @@ class _PlayerSeat extends StatelessWidget {
|
||||
Text(
|
||||
'${player.coins}',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFE9B949),
|
||||
color: AppColors.gold,
|
||||
fontSize: diameter * 0.16,
|
||||
),
|
||||
),
|
||||
@@ -450,7 +436,7 @@ class _RingPainter extends CustomPainter {
|
||||
const start = -1.5708; // بالا
|
||||
final sweep = 6.28318 * left;
|
||||
final color =
|
||||
left < 0.3 ? const Color(0xFFE53935) : const Color(0xFF4CD964);
|
||||
left < 0.3 ? AppColors.suitRed : AppColors.online;
|
||||
canvas.drawArc(
|
||||
Rect.fromCircle(center: center, radius: radius),
|
||||
start,
|
||||
@@ -524,7 +510,7 @@ class _TricksBadgeState extends State<_TricksBadge>
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF7B0E14),
|
||||
borderRadius: BorderRadius.circular(d),
|
||||
border: Border.all(color: const Color(0xFFE9B949), width: 1.4),
|
||||
border: Border.all(color: AppColors.gold, width: 1.4),
|
||||
boxShadow: const [BoxShadow(color: Colors.black54, blurRadius: 4)],
|
||||
),
|
||||
child: Row(
|
||||
@@ -566,7 +552,7 @@ class _RoundBtn extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: const Color(0xFFE9B949), width: 1.6),
|
||||
border: Border.all(color: AppColors.gold, width: 1.6),
|
||||
boxShadow: const [BoxShadow(color: Colors.black54, blurRadius: 6)],
|
||||
),
|
||||
child: Icon(icon, color: Colors.white, size: size * 0.5),
|
||||
|
||||
Reference in New Issue
Block a user