fix(ui): 모든 화면에 SafeArea 적용
- new_character_screen: SafeArea(top: false) 추가 - mobile_carousel_layout: SafeArea(top: false) 추가 - hall_of_fame_screen: SafeArea(top: false) 추가 - 안드로이드 네비게이션 바에 UI가 가려지는 문제 해결
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:askiineverdie/data/class_data.dart';
|
||||
import 'package:askiineverdie/data/game_text_l10n.dart' as game_l10n;
|
||||
import 'package:askiineverdie/data/race_data.dart';
|
||||
import 'package:askiineverdie/l10n/app_localizations.dart';
|
||||
import 'package:askiineverdie/src/core/model/class_traits.dart';
|
||||
import 'package:askiineverdie/src/core/model/game_state.dart';
|
||||
import 'package:askiineverdie/src/core/model/race_traits.dart';
|
||||
import 'package:askiineverdie/src/core/util/deterministic_random.dart';
|
||||
import 'package:askiineverdie/src/core/l10n/game_data_l10n.dart';
|
||||
import 'package:askiineverdie/src/core/util/pq_logic.dart';
|
||||
import 'package:askiineverdie/src/features/new_character/widgets/race_preview.dart';
|
||||
import 'package:askiineverdie/src/shared/retro_colors.dart';
|
||||
import 'package:askiineverdie/src/shared/widgets/retro_widgets.dart';
|
||||
import 'package:asciineverdie/data/class_data.dart';
|
||||
import 'package:asciineverdie/data/game_text_l10n.dart' as game_l10n;
|
||||
import 'package:asciineverdie/data/race_data.dart';
|
||||
import 'package:asciineverdie/l10n/app_localizations.dart';
|
||||
import 'package:asciineverdie/src/core/model/class_traits.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/core/model/race_traits.dart';
|
||||
import 'package:asciineverdie/src/core/util/deterministic_random.dart';
|
||||
import 'package:asciineverdie/src/core/l10n/game_data_l10n.dart';
|
||||
import 'package:asciineverdie/src/core/util/pq_logic.dart';
|
||||
import 'package:asciineverdie/src/features/new_character/widgets/race_preview.dart';
|
||||
import 'package:asciineverdie/src/shared/retro_colors.dart';
|
||||
import 'package:asciineverdie/src/shared/widgets/retro_widgets.dart';
|
||||
|
||||
/// 캐릭터 생성 화면 (NewGuy.pas 포팅)
|
||||
class NewCharacterScreen extends StatefulWidget {
|
||||
@@ -60,8 +61,8 @@ class _NewCharacterScreenState extends State<NewCharacterScreen> {
|
||||
// 이름 생성용 RNG
|
||||
late DeterministicRandom _nameRng;
|
||||
|
||||
// 테스트 모드 (웹에서 모바일 캐로셀 레이아웃 활성화)
|
||||
bool _testModeEnabled = false;
|
||||
// 치트 모드 (디버그 전용: 100x 터보 배속 활성화)
|
||||
bool _cheatsEnabled = false;
|
||||
|
||||
// 굴리기 버튼 연속 클릭 방지
|
||||
bool _isRolling = false;
|
||||
@@ -264,7 +265,7 @@ class _NewCharacterScreenState extends State<NewCharacterScreen> {
|
||||
queue: QueueState.empty(),
|
||||
);
|
||||
|
||||
widget.onCharacterCreated?.call(initialState, testMode: _testModeEnabled);
|
||||
widget.onCharacterCreated?.call(initialState, testMode: _cheatsEnabled);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -284,53 +285,100 @@ class _NewCharacterScreenState extends State<NewCharacterScreen> {
|
||||
centerTitle: true,
|
||||
iconTheme: const IconThemeData(color: RetroColors.gold),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// 이름 입력 섹션
|
||||
_buildNameSection(),
|
||||
const SizedBox(height: 16),
|
||||
body: SafeArea(
|
||||
top: false, // AppBar가 상단 처리
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// 이름 입력 섹션
|
||||
_buildNameSection(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 능력치 섹션
|
||||
_buildStatsSection(),
|
||||
const SizedBox(height: 16),
|
||||
// 능력치 섹션
|
||||
_buildStatsSection(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 종족 미리보기 (Phase 5: 종족별 캐릭터 애니메이션)
|
||||
RetroPanel(
|
||||
title: 'PREVIEW',
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: RacePreview(
|
||||
raceId: _races[_selectedRaceIndex].raceId,
|
||||
// 종족 미리보기 (Phase 5: 종족별 캐릭터 애니메이션)
|
||||
RetroPanel(
|
||||
title: 'PREVIEW',
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Center(
|
||||
child: RacePreview(raceId: _races[_selectedRaceIndex].raceId),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 종족/직업 선택 섹션
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: _buildRaceSection()),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(child: _buildKlassSection()),
|
||||
// 종족/직업 선택 섹션
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: _buildRaceSection()),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(child: _buildKlassSection()),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Sold! 버튼
|
||||
RetroTextButton(
|
||||
text: L10n.of(context).soldButton,
|
||||
icon: Icons.check,
|
||||
onPressed: _onSold,
|
||||
),
|
||||
|
||||
// 디버그 전용: 치트 모드 토글 (100x 터보 배속)
|
||||
if (kDebugMode) ...[
|
||||
const SizedBox(height: 16),
|
||||
GestureDetector(
|
||||
onTap: () => setState(() => _cheatsEnabled = !_cheatsEnabled),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: _cheatsEnabled
|
||||
? RetroColors.hpRed.withValues(alpha: 0.3)
|
||||
: RetroColors.panelBg,
|
||||
border: Border.all(
|
||||
color: _cheatsEnabled
|
||||
? RetroColors.hpRed
|
||||
: RetroColors.panelBorderInner,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
_cheatsEnabled
|
||||
? Icons.bug_report
|
||||
: Icons.bug_report_outlined,
|
||||
size: 16,
|
||||
color: _cheatsEnabled
|
||||
? RetroColors.hpRed
|
||||
: RetroColors.textDisabled,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'DEBUG: TURBO MODE (100x)',
|
||||
style: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 8,
|
||||
color: _cheatsEnabled
|
||||
? RetroColors.hpRed
|
||||
: RetroColors.textDisabled,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 테스트 모드 토글 (웹에서 모바일 레이아웃 테스트)
|
||||
_buildTestModeToggle(),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Sold! 버튼
|
||||
RetroTextButton(
|
||||
text: L10n.of(context).soldButton,
|
||||
icon: Icons.check,
|
||||
onPressed: _onSold,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -372,10 +420,7 @@ class _NewCharacterScreenState extends State<NewCharacterScreen> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
RetroIconButton(
|
||||
icon: Icons.casino,
|
||||
onPressed: _onGenerateName,
|
||||
),
|
||||
RetroIconButton(icon: Icons.casino, onPressed: _onGenerateName),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -735,84 +780,4 @@ class _NewCharacterScreenState extends State<NewCharacterScreen> {
|
||||
};
|
||||
}
|
||||
|
||||
/// 테스트 모드 토글 위젯
|
||||
Widget _buildTestModeToggle() {
|
||||
return RetroPanel(
|
||||
title: 'OPTIONS',
|
||||
child: GestureDetector(
|
||||
onTap: () => setState(() => _testModeEnabled = !_testModeEnabled),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.phone_android,
|
||||
size: 18,
|
||||
color: _testModeEnabled
|
||||
? RetroColors.gold
|
||||
: RetroColors.textDisabled,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
game_l10n.uiTestMode,
|
||||
style: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 8,
|
||||
color: _testModeEnabled
|
||||
? RetroColors.gold
|
||||
: RetroColors.textLight,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
game_l10n.uiTestModeDesc,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 6,
|
||||
color: RetroColors.textDisabled,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 40,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
color: _testModeEnabled
|
||||
? RetroColors.expGreen
|
||||
: RetroColors.panelBgLight,
|
||||
border: Border.all(
|
||||
color: _testModeEnabled
|
||||
? RetroColors.expGreen
|
||||
: RetroColors.panelBorderInner,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: _testModeEnabled
|
||||
? MainAxisAlignment.end
|
||||
: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 16,
|
||||
height: 16,
|
||||
margin: const EdgeInsets.all(1),
|
||||
color: _testModeEnabled
|
||||
? RetroColors.textLight
|
||||
: RetroColors.textDisabled,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user