style: ui perfection
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user