From 27e21bb0642734e5f9e0c4cb1d85ef26e59c7bed Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Wed, 17 Dec 2025 19:23:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(cinematic):=20=EC=8B=9C=EB=84=A4=EB=A7=88?= =?UTF-8?q?=ED=8B=B1/=ED=81=B4=EB=A6=AC=EC=96=B4=20=EB=8B=A4=EC=9D=B4?= =?UTF-8?q?=EC=96=BC=EB=A1=9C=EA=B7=B8=20=ED=91=9C=EC=8B=9C=20=ED=83=80?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 리스너 콜백 중 showDialog 호출로 인한 게임 멈춤 현상 수정 - addPostFrameCallback으로 다음 프레임에서 다이얼로그 표시 - 위젯 트리가 안정된 상태에서 showDialog 실행 --- lib/src/features/game/game_play_screen.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/src/features/game/game_play_screen.dart b/lib/src/features/game/game_play_screen.dart index 256a1e8..eeebfba 100644 --- a/lib/src/features/game/game_play_screen.dart +++ b/lib/src/features/game/game_play_screen.dart @@ -74,11 +74,16 @@ class _GamePlayScreenState extends State _lastAct = newAct; // Phase 10: 엔딩 도달 시 클리어 처리 (시네마틱 대신 클리어 다이얼로그) + // 다음 프레임에서 실행 (리스너 콜백 중 showDialog 문제 방지) if (newAct == StoryAct.ending && state.traits.level >= 100) { - _handleGameClear(state); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) _handleGameClear(state); + }); } else { // 일반 Act 전환 시 시네마틱 표시 - _showCinematicForAct(newAct); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) _showCinematicForAct(newAct); + }); } } }