style: ui perfection

This commit is contained in:
2026-06-24 09:09:00 +03:30
parent 108a972761
commit 08937a66cb
4 changed files with 536 additions and 172 deletions
@@ -16,6 +16,7 @@ import '../../domain/entities/game_entities.dart';
import '../bloc/game_bloc.dart';
import '../bloc/game_state.dart';
import '../widgets/flame/hokm_game.dart';
import '../widgets/table_hud.dart';
/// صفحه‌ی میز بازی: صحنه‌ی Flame + اوورلی‌های وضعیت.
class GameScreen extends StatefulWidget {
@@ -100,7 +101,18 @@ class _GameScreenState extends State<GameScreen> {
return Stack(
children: [
GameWidget(game: _game),
_backButton(context),
if (!_showSearch(state) && state.state != null)
TableHud(
s: state.state!,
connection: state.connection,
onExit: () => _confirmLeave(context),
onChat: () => ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('گفتگو به‌زودی'),
duration: Duration(seconds: 1),
),
),
),
if (state.connection == WsStatus.disconnected) _connBanner(),
if (_showSearch(state)) _searchPanel(state),
// دیالوگِ انتخابِ حکم و بنرِ نوبت فقط پس از پایانِ انیمیشنِ
@@ -166,17 +178,6 @@ class _GameScreenState extends State<GameScreen> {
s.state!.amHakem &&
s.gameOver == null;
Widget _backButton(BuildContext context) => Positioned(
top: 8,
right: 8,
child: SafeArea(
child: IconButton(
icon: const Icon(Icons.arrow_back, color: AppColors.gold),
onPressed: () => _confirmLeave(context),
),
),
);
Future<void> _confirmLeave(BuildContext context) async {
if (context.read<GameBloc>().state.gameOver != null) {
_exitToLobby(context);