feat(mobile): 모바일 옵션 메뉴에 통계/도움말 추가 및 오버플로우 수정
- MobileCarouselLayout에 onShowStatistics, onShowHelp 콜백 추가 - 옵션 메뉴에 통계, 도움말 메뉴 항목 추가 - SingleChildScrollView로 메뉴 오버플로우 방지 - isScrollControlled와 maxHeight 제약 조건 적용
This commit is contained in:
@@ -43,6 +43,8 @@ class MobileCarouselLayout extends StatefulWidget {
|
||||
this.sfxVolume = 0.8,
|
||||
this.onBgmVolumeChange,
|
||||
this.onSfxVolumeChange,
|
||||
this.onShowStatistics,
|
||||
this.onShowHelp,
|
||||
});
|
||||
|
||||
final GameState state;
|
||||
@@ -72,6 +74,12 @@ class MobileCarouselLayout extends StatefulWidget {
|
||||
/// SFX 볼륨 변경 콜백
|
||||
final void Function(double volume)? onSfxVolumeChange;
|
||||
|
||||
/// 통계 표시 콜백
|
||||
final VoidCallback? onShowStatistics;
|
||||
|
||||
/// 도움말 표시 콜백
|
||||
final VoidCallback? onShowHelp;
|
||||
|
||||
@override
|
||||
State<MobileCarouselLayout> createState() => _MobileCarouselLayoutState();
|
||||
}
|
||||
@@ -349,10 +357,15 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
||||
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.of(context).size.height * 0.7,
|
||||
),
|
||||
builder: (context) => SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 헤더
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -410,6 +423,32 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
||||
},
|
||||
),
|
||||
|
||||
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),
|
||||
@@ -506,6 +545,7 @@ class _MobileCarouselLayoutState extends State<MobileCarouselLayout> {
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user