Changed the overall return type for gamemodes

This commit is contained in:
2025-07-20 16:34:00 +02:00
parent 96471a5764
commit 261e8f80c1
9 changed files with 103 additions and 100 deletions

View File

@@ -77,7 +77,8 @@ class _MainMenuViewState extends State<MainMenuView> {
onPressed: () => Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => const CreateGameView(),
builder: (context) => CreateGameView(
gameMode: ConfigService.getGameMode()),
),
),
icon: const Icon(CupertinoIcons.add)),
@@ -96,8 +97,8 @@ class _MainMenuViewState extends State<MainMenuView> {
onTap: () => Navigator.push(
context,
CupertinoPageRoute(
builder: (context) =>
const CreateGameView(),
builder: (context) => CreateGameView(
gameMode: ConfigService.getGameMode()),
),
),
child: Icon(
@@ -216,9 +217,9 @@ 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 '${ConfigService.pointLimit} ${AppLocalizations.of(context).points}';
String _translateGameMode(bool isPointLimitEnabled) {
if (isPointLimitEnabled) {
return '${ConfigService.getPointLimit()} ${AppLocalizations.of(context).points}';
}
return AppLocalizations.of(context).unlimited;
}