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,21 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:askiineverdie/src/core/notification/notification_service.dart';
|
||||
import 'package:askiineverdie/data/game_text_l10n.dart' as l10n;
|
||||
import 'package:askiineverdie/l10n/app_localizations.dart';
|
||||
import 'package:askiineverdie/src/core/animation/ascii_animation_type.dart';
|
||||
import 'package:askiineverdie/src/core/model/game_state.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/character_sheet_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/combat_log_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/equipment_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/inventory_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/quest_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/skills_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/pages/story_page.dart';
|
||||
import 'package:askiineverdie/src/features/game/widgets/carousel_nav_bar.dart';
|
||||
import 'package:askiineverdie/src/features/game/widgets/combat_log.dart';
|
||||
import 'package:askiineverdie/src/features/game/widgets/enhanced_animation_panel.dart';
|
||||
import 'package:askiineverdie/src/shared/retro_colors.dart';
|
||||
import 'package:asciineverdie/src/core/notification/notification_service.dart';
|
||||
import 'package:asciineverdie/data/game_text_l10n.dart' as l10n;
|
||||
import 'package:asciineverdie/l10n/app_localizations.dart';
|
||||
import 'package:asciineverdie/src/core/animation/ascii_animation_type.dart';
|
||||
import 'package:asciineverdie/src/core/model/game_state.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/character_sheet_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/combat_log_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/equipment_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/inventory_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/quest_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/skills_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/pages/story_page.dart';
|
||||
import 'package:asciineverdie/src/features/game/widgets/carousel_nav_bar.dart';
|
||||
import 'package:asciineverdie/src/features/game/widgets/combat_log.dart';
|
||||
import 'package:asciineverdie/src/features/game/widgets/enhanced_animation_panel.dart';
|
||||
import 'package:asciineverdie/src/shared/retro_colors.dart';
|
||||
|
||||
/// 모바일 캐로셀 레이아웃
|
||||
///
|
||||
@@ -159,11 +159,7 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildThemeOption(
|
||||
BuildContext context,
|
||||
ThemeMode mode,
|
||||
String label,
|
||||
) {
|
||||
Widget _buildThemeOption(BuildContext context, ThemeMode mode, String label) {
|
||||
final isSelected = widget.currentThemeMode == mode;
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
@@ -371,188 +367,189 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 헤더 (레트로 스타일)
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: surface,
|
||||
border: Border(
|
||||
bottom: BorderSide(color: gold, width: 2),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'OPTIONS',
|
||||
style: TextStyle(
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: gold,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// 일시정지/재개
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
widget.isPaused ? Icons.play_arrow : Icons.pause,
|
||||
color: widget.isPaused ? Colors.green : Colors.orange,
|
||||
),
|
||||
title: Text(widget.isPaused ? l10n.menuResume : l10n.menuPause),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onPauseToggle();
|
||||
},
|
||||
),
|
||||
|
||||
// 속도 조절
|
||||
ListTile(
|
||||
leading: const Icon(Icons.speed),
|
||||
title: Text(l10n.menuSpeed),
|
||||
trailing: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 4,
|
||||
),
|
||||
// 헤더 (레트로 스타일)
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: surface,
|
||||
border: Border(bottom: BorderSide(color: gold, width: 2)),
|
||||
),
|
||||
child: Text(
|
||||
'${widget.speedMultiplier}x',
|
||||
'OPTIONS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontFamily: 'PressStart2P',
|
||||
fontSize: 12,
|
||||
color: gold,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
widget.onSpeedCycle();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// 통계
|
||||
if (widget.onShowStatistics != null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.bar_chart, color: Colors.blue),
|
||||
title: Text(l10n.uiStatistics),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onShowStatistics?.call();
|
||||
},
|
||||
),
|
||||
|
||||
// 도움말
|
||||
if (widget.onShowHelp != null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help_outline, color: Colors.green),
|
||||
title: Text(l10n.uiHelp),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onShowHelp?.call();
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// 언어 변경
|
||||
ListTile(
|
||||
leading: const Icon(Icons.language, color: Colors.teal),
|
||||
title: Text(l10n.menuLanguage),
|
||||
trailing: Text(
|
||||
_getCurrentLanguageName(),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showLanguageDialog(context);
|
||||
},
|
||||
),
|
||||
|
||||
// 테마 변경
|
||||
if (widget.onThemeModeChange != null)
|
||||
// 일시정지/재개
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
_getThemeIcon(),
|
||||
color: Colors.purple,
|
||||
),
|
||||
title: Text(l10n.menuTheme),
|
||||
trailing: Text(
|
||||
_getCurrentThemeName(),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary),
|
||||
widget.isPaused ? Icons.play_arrow : Icons.pause,
|
||||
color: widget.isPaused ? Colors.green : Colors.orange,
|
||||
),
|
||||
title: Text(widget.isPaused ? l10n.menuResume : l10n.menuPause),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showThemeDialog(context);
|
||||
widget.onPauseToggle();
|
||||
},
|
||||
),
|
||||
|
||||
// 사운드 설정
|
||||
if (widget.onBgmVolumeChange != null ||
|
||||
widget.onSfxVolumeChange != null)
|
||||
// 속도 조절
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
widget.bgmVolume == 0 && widget.sfxVolume == 0
|
||||
? Icons.volume_off
|
||||
: Icons.volume_up,
|
||||
color: Colors.indigo,
|
||||
),
|
||||
title: Text(l10n.uiSound),
|
||||
trailing: Text(
|
||||
_getSoundStatus(),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary),
|
||||
leading: const Icon(Icons.speed),
|
||||
title: Text(l10n.menuSpeed),
|
||||
trailing: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text(
|
||||
'${widget.speedMultiplier}x',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
widget.onSpeedCycle();
|
||||
Navigator.pop(context);
|
||||
_showSoundDialog(context);
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
const Divider(),
|
||||
|
||||
// 저장
|
||||
ListTile(
|
||||
leading: const Icon(Icons.save, color: Colors.blue),
|
||||
title: Text(l10n.menuSave),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onSave();
|
||||
widget.notificationService.showGameSaved(l10n.menuSaved);
|
||||
},
|
||||
),
|
||||
|
||||
// 새로하기 (세이브 삭제)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.refresh, color: Colors.orange),
|
||||
title: Text(l10n.menuNewGame),
|
||||
subtitle: Text(
|
||||
l10n.menuDeleteSave,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
// 통계
|
||||
if (widget.onShowStatistics != null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.bar_chart, color: Colors.blue),
|
||||
title: Text(l10n.uiStatistics),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onShowStatistics?.call();
|
||||
},
|
||||
),
|
||||
|
||||
// 도움말
|
||||
if (widget.onShowHelp != null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help_outline, color: Colors.green),
|
||||
title: Text(l10n.uiHelp),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onShowHelp?.call();
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// 언어 변경
|
||||
ListTile(
|
||||
leading: const Icon(Icons.language, color: Colors.teal),
|
||||
title: Text(l10n.menuLanguage),
|
||||
trailing: Text(
|
||||
_getCurrentLanguageName(),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showLanguageDialog(context);
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showDeleteConfirmDialog(context);
|
||||
},
|
||||
),
|
||||
|
||||
// 종료
|
||||
ListTile(
|
||||
leading: const Icon(Icons.exit_to_app, color: Colors.red),
|
||||
title: Text(localizations.exitGame),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onExit();
|
||||
},
|
||||
),
|
||||
// 테마 변경
|
||||
if (widget.onThemeModeChange != null)
|
||||
ListTile(
|
||||
leading: Icon(_getThemeIcon(), color: Colors.purple),
|
||||
title: Text(l10n.menuTheme),
|
||||
trailing: Text(
|
||||
_getCurrentThemeName(),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showThemeDialog(context);
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
// 사운드 설정
|
||||
if (widget.onBgmVolumeChange != null ||
|
||||
widget.onSfxVolumeChange != null)
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
widget.bgmVolume == 0 && widget.sfxVolume == 0
|
||||
? Icons.volume_off
|
||||
: Icons.volume_up,
|
||||
color: Colors.indigo,
|
||||
),
|
||||
title: Text(l10n.uiSound),
|
||||
trailing: Text(
|
||||
_getSoundStatus(),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showSoundDialog(context);
|
||||
},
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// 저장
|
||||
ListTile(
|
||||
leading: const Icon(Icons.save, color: Colors.blue),
|
||||
title: Text(l10n.menuSave),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onSave();
|
||||
widget.notificationService.showGameSaved(l10n.menuSaved);
|
||||
},
|
||||
),
|
||||
|
||||
// 새로하기 (세이브 삭제)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.refresh, color: Colors.orange),
|
||||
title: Text(l10n.menuNewGame),
|
||||
subtitle: Text(
|
||||
l10n.menuDeleteSave,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
_showDeleteConfirmDialog(context);
|
||||
},
|
||||
),
|
||||
|
||||
// 종료
|
||||
ListTile(
|
||||
leading: const Icon(Icons.exit_to_app, color: Colors.red),
|
||||
title: Text(localizations.exitGame),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onExit();
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -586,82 +583,86 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
// 상단: 확장 애니메이션 패널
|
||||
EnhancedAnimationPanel(
|
||||
progress: state.progress,
|
||||
stats: state.stats,
|
||||
skillSystem: state.skillSystem,
|
||||
speedMultiplier: widget.speedMultiplier,
|
||||
onSpeedCycle: widget.onSpeedCycle,
|
||||
isPaused: widget.isPaused,
|
||||
onPauseToggle: widget.onPauseToggle,
|
||||
specialAnimation: widget.specialAnimation,
|
||||
weaponName: state.equipment.weapon,
|
||||
shieldName: state.equipment.shield,
|
||||
characterLevel: state.traits.level,
|
||||
monsterLevel: state.progress.currentTask.monsterLevel,
|
||||
latestCombatEvent:
|
||||
state.progress.currentCombat?.recentEvents.lastOrNull,
|
||||
raceId: state.traits.raceId,
|
||||
),
|
||||
|
||||
// 중앙: 캐로셀 (PageView)
|
||||
Expanded(
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: _onPageChanged,
|
||||
children: [
|
||||
// 0: 스킬
|
||||
SkillsPage(
|
||||
spellBook: state.spellBook,
|
||||
skillSystem: state.skillSystem,
|
||||
),
|
||||
|
||||
// 1: 인벤토리
|
||||
InventoryPage(
|
||||
inventory: state.inventory,
|
||||
potionInventory: state.potionInventory,
|
||||
encumbrance: state.progress.encumbrance,
|
||||
usedPotionTypes:
|
||||
state.progress.currentCombat?.usedPotionTypes ?? const {},
|
||||
),
|
||||
|
||||
// 2: 장비
|
||||
EquipmentPage(equipment: state.equipment),
|
||||
|
||||
// 3: 캐릭터시트 (기본)
|
||||
CharacterSheetPage(
|
||||
traits: state.traits,
|
||||
stats: state.stats,
|
||||
exp: state.progress.exp,
|
||||
),
|
||||
|
||||
// 4: 전투로그
|
||||
CombatLogPage(entries: widget.combatLogEntries),
|
||||
|
||||
// 5: 퀘스트
|
||||
QuestPage(
|
||||
questHistory: state.progress.questHistory,
|
||||
quest: state.progress.quest,
|
||||
),
|
||||
|
||||
// 6: 스토리
|
||||
StoryPage(
|
||||
plotStageCount: state.progress.plotStageCount,
|
||||
plot: state.progress.plot,
|
||||
),
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false, // AppBar가 상단 처리
|
||||
child: Column(
|
||||
children: [
|
||||
// 상단: 확장 애니메이션 패널
|
||||
EnhancedAnimationPanel(
|
||||
progress: state.progress,
|
||||
stats: state.stats,
|
||||
skillSystem: state.skillSystem,
|
||||
speedMultiplier: widget.speedMultiplier,
|
||||
onSpeedCycle: widget.onSpeedCycle,
|
||||
isPaused: widget.isPaused,
|
||||
onPauseToggle: widget.onPauseToggle,
|
||||
specialAnimation: widget.specialAnimation,
|
||||
weaponName: state.equipment.weapon,
|
||||
shieldName: state.equipment.shield,
|
||||
characterLevel: state.traits.level,
|
||||
monsterLevel: state.progress.currentTask.monsterLevel,
|
||||
latestCombatEvent:
|
||||
state.progress.currentCombat?.recentEvents.lastOrNull,
|
||||
raceId: state.traits.raceId,
|
||||
),
|
||||
),
|
||||
|
||||
// 하단: 네비게이션 바
|
||||
CarouselNavBar(
|
||||
currentPage: _currentPage,
|
||||
onPageSelected: _onNavPageSelected,
|
||||
),
|
||||
],
|
||||
// 중앙: 캐로셀 (PageView)
|
||||
Expanded(
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: _onPageChanged,
|
||||
children: [
|
||||
// 0: 스킬
|
||||
SkillsPage(
|
||||
spellBook: state.spellBook,
|
||||
skillSystem: state.skillSystem,
|
||||
),
|
||||
|
||||
// 1: 인벤토리
|
||||
InventoryPage(
|
||||
inventory: state.inventory,
|
||||
potionInventory: state.potionInventory,
|
||||
encumbrance: state.progress.encumbrance,
|
||||
usedPotionTypes:
|
||||
state.progress.currentCombat?.usedPotionTypes ??
|
||||
const {},
|
||||
),
|
||||
|
||||
// 2: 장비
|
||||
EquipmentPage(equipment: state.equipment),
|
||||
|
||||
// 3: 캐릭터시트 (기본)
|
||||
CharacterSheetPage(
|
||||
traits: state.traits,
|
||||
stats: state.stats,
|
||||
exp: state.progress.exp,
|
||||
),
|
||||
|
||||
// 4: 전투로그
|
||||
CombatLogPage(entries: widget.combatLogEntries),
|
||||
|
||||
// 5: 퀘스트
|
||||
QuestPage(
|
||||
questHistory: state.progress.questHistory,
|
||||
quest: state.progress.quest,
|
||||
),
|
||||
|
||||
// 6: 스토리
|
||||
StoryPage(
|
||||
plotStageCount: state.progress.plotStageCount,
|
||||
plot: state.progress.plot,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// 하단: 네비게이션 바
|
||||
CarouselNavBar(
|
||||
currentPage: _currentPage,
|
||||
onPageSelected: _onNavPageSelected,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user