From 354922b93d1a1716d22784e0e7d8d303a60421f9 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 17 Aug 2025 20:33:54 +0200 Subject: [PATCH] Updated navigation for creating a game --- .../views/home/active_game/active_game_view.dart | 2 +- lib/presentation/views/home/create_game_view.dart | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/presentation/views/home/active_game/active_game_view.dart b/lib/presentation/views/home/active_game/active_game_view.dart index 4434787..60ae16d 100644 --- a/lib/presentation/views/home/active_game/active_game_view.dart +++ b/lib/presentation/views/home/active_game/active_game_view.dart @@ -221,7 +221,7 @@ class _ActiveGameViewState extends State { backgroundColorActivated: CustomTheme.backgroundColor, onTap: () { - Navigator.pushReplacement( + Navigator.push( context, CupertinoPageRoute( builder: (_) => CreateGameView( diff --git a/lib/presentation/views/home/create_game_view.dart b/lib/presentation/views/home/create_game_view.dart index d92a375..8b18bfc 100644 --- a/lib/presentation/views/home/create_game_view.dart +++ b/lib/presentation/views/home/create_game_view.dart @@ -452,10 +452,12 @@ class _CreateGameViewState extends State { gameManager.addGameSession(gameSession); final session = gameManager.getGameSessionById(id) ?? gameSession; - Navigator.pushReplacement( - context, - CupertinoPageRoute( - builder: (context) => ActiveGameView(gameSession: session))); + Navigator.pushAndRemoveUntil( + context, + CupertinoPageRoute( + builder: (context) => ActiveGameView(gameSession: session)), + (Route route) => route.isFirst, + ); } @override