Merge pull request #47 from flixcoo/bug/33-ui-inconsistencies

Fixed wrong pointLimit shown
This commit is contained in:
2025-06-12 10:25:13 +02:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -70,7 +70,9 @@ class _CreateGameState extends State<CreateGame> {
Text(
selectedMode == null
? 'Wähle einen Modus'
: (selectedMode! ? '101 Punkte' : 'Unbegrenzt'),
: (selectedMode!
? '${Globals.pointLimit} Punkte'
: 'Unbegrenzt'),
),
const SizedBox(width: 3),
const CupertinoListTileChevron(),
@@ -290,16 +292,13 @@ class _CreateGameState extends State<CreateGame> {
isPointsLimitEnabled: selectedMode!,
);
final index = await gameManager.addGameSession(gameSession);
print('index des spiels: $index');
if (context.mounted) {
Navigator.pushReplacement(
context,
CupertinoPageRoute(
builder: (context) => ActiveGameView(
gameSession: gameManager.gameList[index])));
} else {
print('Context is not mounted');
}
} else {}
},
),
),

View File

@@ -1,6 +1,7 @@
import 'package:cabo_counter/data/game_manager.dart';
import 'package:cabo_counter/services/local_storage_service.dart';
import 'package:cabo_counter/utility/custom_theme.dart';
import 'package:cabo_counter/utility/globals.dart';
import 'package:cabo_counter/views/active_game_view.dart';
import 'package:cabo_counter/views/create_game_view.dart';
import 'package:cabo_counter/views/settings_view.dart';
@@ -185,7 +186,7 @@ class _MainMenuViewState extends State<MainMenuView> {
/// Translates the game mode boolean into the corresponding String.
/// If [pointLimit] is true, it returns '101 Punkte', otherwise it returns 'Unbegrenzt'.
String _translateGameMode(bool pointLimit) {
if (pointLimit) return '101 Punkte';
if (pointLimit) return '${Globals.pointLimit} Punkte';
return 'Unbegrenzt';
}

View File

@@ -2,7 +2,7 @@ name: cabo_counter
description: "Mobile app for the card game Cabo"
publish_to: 'none'
version: 0.2.5+195
version: 0.2.6+197
environment:
sdk: ^3.5.4