From 722b8357ac0d8b902b105d55ac99a5a203981207 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 1 Jul 2025 21:46:01 +0200 Subject: [PATCH] Added navigation on the big plus button in home menu --- lib/views/main_menu_view.dart | 22 +++++++++++++++------- pubspec.yaml | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/views/main_menu_view.dart b/lib/views/main_menu_view.dart index 90c384c..2f5eee9 100644 --- a/lib/views/main_menu_view.dart +++ b/lib/views/main_menu_view.dart @@ -50,7 +50,9 @@ class _MainMenuViewState extends State { CupertinoPageRoute( builder: (context) => const SettingsView(), ), - ); + ).then((_) { + setState(() {}); + }); }, icon: const Icon(CupertinoIcons.settings, size: 30)), middle: const Text('Cabo Counter'), @@ -77,7 +79,12 @@ class _MainMenuViewState extends State { const SizedBox(height: 30), // Abstand von oben Center( child: GestureDetector( - onTap: () => setState(() {}), + onTap: () => Navigator.push( + context, + CupertinoPageRoute( + builder: (context) => const CreateGame(), + ), + ), child: Icon( CupertinoIcons.plus, size: 60, @@ -85,15 +92,16 @@ class _MainMenuViewState extends State { ), )), const SizedBox(height: 10), // Abstand von oben - const Padding( - padding: EdgeInsets.symmetric(horizontal: 70), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 70), child: Text( - 'Ganz schön leer hier...\nFüge über den Button oben rechts eine neue Runde hinzu.', + '${AppLocalizations.of(context).empty_text_1}\n${AppLocalizations.of(context).empty_text_2}', textAlign: TextAlign.center, - style: TextStyle(fontSize: 16), + style: const TextStyle(fontSize: 16), ), ), - ], + ], //Ganz schön leer hier... Füge über den Button oben rechts eine neue Runde hinzu. ) : ListView.builder( itemCount: gameManager.gameList.length, diff --git a/pubspec.yaml b/pubspec.yaml index b0bf86a..89087f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.3.2+244 +version: 0.3.2+245 environment: sdk: ^3.5.4