From 0ac446b0329265bdf0cc6c3a701ddd9f3c1dc77c Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 16:46:20 +0200 Subject: [PATCH 01/11] Added new kamikaze button and bundles navigation functionality --- lib/l10n/arb/app_de.arb | 1 + lib/l10n/arb/app_en.arb | 1 + lib/l10n/generated/app_localizations.dart | 6 ++ lib/l10n/generated/app_localizations_de.dart | 3 + lib/l10n/generated/app_localizations_en.dart | 3 + lib/presentation/views/round_view.dart | 93 +++++++++++++++----- pubspec.yaml | 2 +- 7 files changed, 84 insertions(+), 25 deletions(-) diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index 399aefd..dceb8fc 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -71,6 +71,7 @@ "results": "Ergebnisse", "who_said_cabo": "Wer hat CABO gesagt?", "kamikaze": "Kamikaze", + "who_has_kamikaze": "Wer hat Kamikaze?", "done": "Fertig", "next_round": "Nächste Runde", "bonus_points_title": "Bonus-Punkte!", diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 3b6150a..3009d6e 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -71,6 +71,7 @@ "results": "Results", "who_said_cabo": "Who called Cabo?", "kamikaze": "Kamikaze", + "who_has_kamikaze": "Who has Kamikaze?", "done": "Done", "next_round": "Next Round", "bonus_points_title": "Bonus-Points!", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index 7ce3c52..695fb57 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -404,6 +404,12 @@ abstract class AppLocalizations { /// **'Kamikaze'** String get kamikaze; + /// No description provided for @who_has_kamikaze. + /// + /// In de, this message translates to: + /// **'Wer hat Kamikaze?'** + String get who_has_kamikaze; + /// No description provided for @done. /// /// In de, this message translates to: diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index 6539c20..3ef54b8 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -172,6 +172,9 @@ class AppLocalizationsDe extends AppLocalizations { @override String get kamikaze => 'Kamikaze'; + @override + String get who_has_kamikaze => 'Wer hat Kamikaze?'; + @override String get done => 'Fertig'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 7e026f6..8a86b95 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -170,6 +170,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get kamikaze => 'Kamikaze'; + @override + String get who_has_kamikaze => 'Who has Kamikaze?'; + @override String get done => 'Done'; diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 9e2b40f..45834e4 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -154,6 +154,17 @@ class _RoundViewState extends State { ), ), ), + Center( + child: CupertinoButton( + onPressed: () async { + if (await _showKamikazeSheet(context)) { + if (!context.mounted) return; + _endOfRoundNavigation(context, true); + } + }, + child: Text(AppLocalizations.of(context).kamikaze), + ), + ), Padding( padding: const EdgeInsets.symmetric(horizontal: 20.0), child: CupertinoListTile( @@ -308,15 +319,8 @@ class _RoundViewState extends State { children: [ CupertinoButton( onPressed: _areRoundInputsValid() - ? () async { - List bonusPlayersIndices = _finishRound(); - if (bonusPlayersIndices.isNotEmpty) { - await _showBonusPopup( - context, bonusPlayersIndices); - } - LocalStorageService.saveGameSessions(); - if (!context.mounted) return; - Navigator.pop(context); + ? () { + _endOfRoundNavigation(context, false); } : null, child: Text(AppLocalizations.of(context).done), @@ -324,21 +328,8 @@ class _RoundViewState extends State { if (!widget.gameSession.isGameFinished) CupertinoButton( onPressed: _areRoundInputsValid() - ? () async { - List bonusPlayersIndices = - _finishRound(); - if (bonusPlayersIndices.isNotEmpty) { - await _showBonusPopup( - context, bonusPlayersIndices); - } - LocalStorageService.saveGameSessions(); - if (widget.gameSession.isGameFinished && - context.mounted) { - Navigator.pop(context); - } else if (context.mounted) { - Navigator.pop( - context, widget.roundNumber + 1); - } + ? () { + _endOfRoundNavigation(context, true); } : null, child: Text(AppLocalizations.of(context).next_round), @@ -401,6 +392,36 @@ class _RoundViewState extends State { ]; } + Future _showKamikazeSheet(BuildContext context) async { + return await showCupertinoModalPopup( + context: context, + builder: (BuildContext context) { + return CupertinoActionSheet( + title: Text(AppLocalizations.of(context).kamikaze), + message: Text(AppLocalizations.of(context).who_has_kamikaze), + actions: widget.gameSession.players.asMap().entries.map((entry) { + final index = entry.key; + final name = entry.value; + return CupertinoActionSheetAction( + onPressed: () { + _kamikazePlayerIndex = + _kamikazePlayerIndex == index ? null : index; + Navigator.pop(context, true); + }, + child: Text(name), + ); + }).toList(), + cancelButton: CupertinoActionSheetAction( + onPressed: () => Navigator.pop(context, false), + isDestructiveAction: true, + child: Text(AppLocalizations.of(context).cancel), + ), + ); + }, + ) ?? + false; + } + /// Focuses the next text field in the list of text fields. /// [index] is the index of the current text field. void _focusNextTextfield(int index) { @@ -521,6 +542,30 @@ class _RoundViewState extends State { return resultText; } + /// Handles the navigation for the end of the round. + /// It checks for bonus players and shows a popup, saves the game session, + /// and navigates to the next round or back to the previous screen. + /// It takes the BuildContext [context] and a boolean [navigateToNextRound] to determine + /// if it should navigate to the next round or not. + Future _endOfRoundNavigation( + BuildContext context, bool navigateToNextRound) async { + List bonusPlayersIndices = _finishRound(); + if (bonusPlayersIndices.isNotEmpty) { + await _showBonusPopup(context, bonusPlayersIndices); + } + + LocalStorageService.saveGameSessions(); + + if (context.mounted) { + if (!navigateToNextRound || widget.gameSession.isGameFinished) { + Navigator.pop(context); + return; + } else { + Navigator.pop(context, widget.roundNumber + 1); + } + } + } + @override void dispose() { for (final controller in _scoreControllerList) { diff --git a/pubspec.yaml b/pubspec.yaml index 7f8483c..4a2e99d 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.4.8+525 +version: 0.4.8+526 environment: sdk: ^3.5.4 From 29a042ff16fc7c5a156b48cf6a26d244a51b0904 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:06:07 +0200 Subject: [PATCH 02/11] Updated lock icon --- lib/presentation/views/round_view.dart | 40 +++++++++++++++++--------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 45834e4..2e0edd9 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -74,21 +74,22 @@ class _RoundViewState extends State { return CupertinoPageScaffold( resizeToAvoidBottomInset: false, navigationBar: CupertinoNavigationBar( - transitionBetweenRoutes: true, - leading: CupertinoButton( - padding: EdgeInsets.zero, - onPressed: () => - {LocalStorageService.saveGameSessions(), Navigator.pop(context)}, - child: Text(AppLocalizations.of(context).cancel), - ), - middle: Text(AppLocalizations.of(context).results), - trailing: widget.gameSession.isGameFinished - ? const Icon( + transitionBetweenRoutes: true, + leading: CupertinoButton( + padding: EdgeInsets.zero, + onPressed: () => { + LocalStorageService.saveGameSessions(), + Navigator.pop(context) + }, + child: Text(AppLocalizations.of(context).cancel), + ), + middle: Text(AppLocalizations.of(context).results), + trailing: Visibility( + visible: widget.gameSession.isGameFinished, + child: const Icon( CupertinoIcons.lock, size: 25, - ) - : null, - ), + ))), child: Stack( children: [ Positioned.fill( @@ -155,14 +156,25 @@ class _RoundViewState extends State { ), ), Center( + heightFactor: 1, child: CupertinoButton( + padding: const EdgeInsets.symmetric( + horizontal: 15, vertical: 0), + borderRadius: BorderRadius.circular(12), + color: CupertinoColors.systemRed, onPressed: () async { if (await _showKamikazeSheet(context)) { if (!context.mounted) return; _endOfRoundNavigation(context, true); } }, - child: Text(AppLocalizations.of(context).kamikaze), + child: Text( + AppLocalizations.of(context).kamikaze, + style: const TextStyle( + color: CupertinoColors.white, + fontWeight: FontWeight.bold, + ), + ), ), ), Padding( From 81ada1c8103f9cb72fdcfd185ab3c1de9994a9da Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:18:52 +0200 Subject: [PATCH 03/11] Updated button position and design --- lib/presentation/views/round_view.dart | 45 +++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 2e0edd9..b0c24c8 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -155,28 +155,6 @@ class _RoundViewState extends State { ), ), ), - Center( - heightFactor: 1, - child: CupertinoButton( - padding: const EdgeInsets.symmetric( - horizontal: 15, vertical: 0), - borderRadius: BorderRadius.circular(12), - color: CupertinoColors.systemRed, - onPressed: () async { - if (await _showKamikazeSheet(context)) { - if (!context.mounted) return; - _endOfRoundNavigation(context, true); - } - }, - child: Text( - AppLocalizations.of(context).kamikaze, - style: const TextStyle( - color: CupertinoColors.white, - fontWeight: FontWeight.bold, - ), - ), - ), - ), Padding( padding: const EdgeInsets.symmetric(horizontal: 20.0), child: CupertinoListTile( @@ -311,6 +289,29 @@ class _RoundViewState extends State { ); }, ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 0, 0), + child: Center( + heightFactor: 1, + child: CupertinoButton( + sizeStyle: CupertinoButtonSize.medium, + borderRadius: BorderRadius.circular(15), + color: const Color(0xFF202020), + onPressed: () async { + if (await _showKamikazeSheet(context)) { + if (!context.mounted) return; + _endOfRoundNavigation(context, true); + } + }, + child: Text( + AppLocalizations.of(context).kamikaze, + style: const TextStyle( + color: CupertinoColors.destructiveRed, + ), + ), + ), + ), + ), ], ), ), From 5b704d39376e228671ba3aee0a2b39723cd82606 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:28:19 +0200 Subject: [PATCH 04/11] Removed title row and changed segmendetControl Padding --- lib/presentation/views/round_view.dart | 120 ++++++------------------- pubspec.yaml | 2 +- 2 files changed, 28 insertions(+), 94 deletions(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index b0c24c8..7d5739a 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -115,7 +115,7 @@ class _RoundViewState extends State { vertical: 10, ), child: SizedBox( - height: 40, + height: 60, child: CupertinoSegmentedControl( unselectedColor: CustomTheme.backgroundTintColor, selectedColor: CustomTheme.primaryColor, @@ -131,7 +131,7 @@ class _RoundViewState extends State { Padding( padding: const EdgeInsets.symmetric( horizontal: 6, - vertical: 6, + vertical: 8, ), child: FittedBox( fit: BoxFit.scaleDown, @@ -155,27 +155,6 @@ class _RoundViewState extends State { ), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - child: CupertinoListTile( - title: Text(AppLocalizations.of(context).player), - trailing: Row( - children: [ - SizedBox( - width: 100, - child: Center( - child: Text( - AppLocalizations.of(context).points))), - const SizedBox(width: 20), - SizedBox( - width: 80, - child: Center( - child: Text(AppLocalizations.of(context) - .kamikaze))), - ], - ), - ), - ), ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), @@ -212,77 +191,32 @@ class _RoundViewState extends State { subtitle: Text( '${widget.gameSession.playerScores[originalIndex]}' ' ${AppLocalizations.of(context).points}'), - trailing: Row( - children: [ - SizedBox( - width: 100, - child: CupertinoTextField( - maxLength: 3, - focusNode: _focusNodeList[originalIndex], - keyboardType: - const TextInputType.numberWithOptions( - signed: true, - decimal: false, - ), - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, - ], - textInputAction: index == - widget.gameSession.players - .length - - 1 - ? TextInputAction.done - : TextInputAction.next, - controller: - _scoreControllerList[originalIndex], - placeholder: - AppLocalizations.of(context).points, - textAlign: TextAlign.center, - onSubmitted: (_) => - _focusNextTextfield(originalIndex), - onChanged: (_) => setState(() {}), - ), + trailing: SizedBox( + width: 100, + child: CupertinoTextField( + maxLength: 3, + focusNode: _focusNodeList[originalIndex], + keyboardType: + const TextInputType.numberWithOptions( + signed: true, + decimal: false, ), - const SizedBox(width: 50), - GestureDetector( - onTap: () { - setState(() { - _kamikazePlayerIndex = - (_kamikazePlayerIndex == - originalIndex) - ? null - : originalIndex; - }); - }, - child: Container( - width: 24, - height: 24, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _kamikazePlayerIndex == - originalIndex - ? CupertinoColors.systemRed - : CupertinoColors - .tertiarySystemFill, - border: Border.all( - color: _kamikazePlayerIndex == - originalIndex - ? CupertinoColors.systemRed - : CupertinoColors.systemGrey, - ), - ), - child: _kamikazePlayerIndex == - originalIndex - ? const Icon( - CupertinoIcons.exclamationmark, - size: 16, - color: CupertinoColors.white, - ) - : null, - ), - ), - const SizedBox(width: 22), - ], + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + ], + textInputAction: index == + widget.gameSession.players.length - 1 + ? TextInputAction.done + : TextInputAction.next, + controller: + _scoreControllerList[originalIndex], + placeholder: + AppLocalizations.of(context).points, + textAlign: TextAlign.center, + onSubmitted: (_) => + _focusNextTextfield(originalIndex), + onChanged: (_) => setState(() {}), + ), ), ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 4a2e99d..f1bf78c 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.4.8+526 +version: 0.4.8+529 environment: sdk: ^3.5.4 From f0cfafd5e3678d71c1125a970742d1ff4e42bc3e Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:40:34 +0200 Subject: [PATCH 05/11] Refactored logic and added comments --- lib/presentation/views/round_view.dart | 16 +++++++++++----- pubspec.yaml | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 7d5739a..3d65d17 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -351,8 +351,7 @@ class _RoundViewState extends State { final name = entry.value; return CupertinoActionSheetAction( onPressed: () { - _kamikazePlayerIndex = - _kamikazePlayerIndex == index ? null : index; + _kamikazePlayerIndex = index; Navigator.pop(context, true); }, child: Text(name), @@ -504,12 +503,19 @@ class _RoundViewState extends State { LocalStorageService.saveGameSessions(); if (context.mounted) { - if (!navigateToNextRound || widget.gameSession.isGameFinished) { + // If the game is finished, pop the context and return to the previous screen. + if (widget.gameSession.isGameFinished) { Navigator.pop(context); return; - } else { - Navigator.pop(context, widget.roundNumber + 1); } + // If navigateToNextRound is false, pop the context and return to the previous screen. + if (!navigateToNextRound) { + Navigator.pop(context); + return; + } + // If navigateToNextRound is true and the game isn't finished yet, + // pop the context and navigate to the next round. + Navigator.pop(context, widget.roundNumber + 1); } } diff --git a/pubspec.yaml b/pubspec.yaml index f1bf78c..d9cb654 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.4.8+529 +version: 0.4.9+529 environment: sdk: ^3.5.4 From cdcdd0b78ada780d6ef6255fd1e8435aaef88b7a Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:41:37 +0200 Subject: [PATCH 06/11] Updated comment --- lib/presentation/views/round_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 3d65d17..45c6376 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -438,7 +438,7 @@ class _RoundViewState extends State { return bonusPlayers; } - /// Shows a popup dialog with the bonus information. + /// Shows a popup dialog with the information which player received the bonus points. Future _showBonusPopup( BuildContext context, List bonusPlayers) async { print('Bonus Popup wird angezeigt'); From d10fabb85a117cd4c04f96914f0c2a60133902b7 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:47:51 +0200 Subject: [PATCH 07/11] Chaned icon --- lib/presentation/views/round_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 45c6376..050c2f2 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -184,7 +184,7 @@ class _RoundViewState extends State { ), Visibility( visible: shouldShowMedal, - child: const Icon(FontAwesomeIcons.medal, + child: const Icon(FontAwesomeIcons.crown, size: 15)) ])) ]), From 610cdc10e4bc2751a60c4cc2473146f376575303 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:51:08 +0200 Subject: [PATCH 08/11] Added comment --- lib/presentation/views/round_view.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 050c2f2..f9ef0ee 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -339,6 +339,8 @@ class _RoundViewState extends State { ]; } + /// Shows a Cupertino action sheet to select the player who has Kamikaze. + /// It returns true if a player was selected, false if the action was cancelled. Future _showKamikazeSheet(BuildContext context) async { return await showCupertinoModalPopup( context: context, From b7f6bf93484adfabd336312450b0ef3ec4e537ed Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 17:54:25 +0200 Subject: [PATCH 09/11] Removed print --- lib/presentation/views/round_view.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index f9ef0ee..690e256 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -443,7 +443,6 @@ class _RoundViewState extends State { /// Shows a popup dialog with the information which player received the bonus points. Future _showBonusPopup( BuildContext context, List bonusPlayers) async { - print('Bonus Popup wird angezeigt'); int pointLimit = widget.gameSession.pointLimit; int bonusPoints = (pointLimit / 2).round(); From a7521a3168859820091f8b4e51f2c3da297b0218 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 18:01:39 +0200 Subject: [PATCH 10/11] Updated colors --- lib/core/custom_theme.dart | 4 +++- lib/presentation/views/round_view.dart | 11 ++++++----- lib/presentation/views/tab_view.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/core/custom_theme.dart b/lib/core/custom_theme.dart index fa78cb6..e123779 100644 --- a/lib/core/custom_theme.dart +++ b/lib/core/custom_theme.dart @@ -4,7 +4,9 @@ class CustomTheme { static Color white = CupertinoColors.white; static Color primaryColor = CupertinoColors.systemGreen; static Color backgroundColor = const Color(0xFF101010); - static Color backgroundTintColor = CupertinoColors.darkBackgroundGray; + static Color mainElementbackgroundColor = CupertinoColors.darkBackgroundGray; + static Color playerTileColor = CupertinoColors.secondaryLabel; + static Color buttonBackgroundColor = const Color(0xFF202020); // Line Colors for GraphView static const Color graphColor1 = Color(0xFFF44336); diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 690e256..82af6dc 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -117,7 +117,8 @@ class _RoundViewState extends State { child: SizedBox( height: 60, child: CupertinoSegmentedControl( - unselectedColor: CustomTheme.backgroundTintColor, + unselectedColor: + CustomTheme.mainElementbackgroundColor, selectedColor: CustomTheme.primaryColor, groupValue: _caboPlayerIndex, children: Map.fromEntries(widget.gameSession.players @@ -170,7 +171,7 @@ class _RoundViewState extends State { child: ClipRRect( borderRadius: BorderRadius.circular(12), child: CupertinoListTile( - backgroundColor: CupertinoColors.secondaryLabel, + backgroundColor: CustomTheme.playerTileColor, title: Row(children: [ Expanded( child: Row(children: [ @@ -229,8 +230,8 @@ class _RoundViewState extends State { heightFactor: 1, child: CupertinoButton( sizeStyle: CupertinoButtonSize.medium, - borderRadius: BorderRadius.circular(15), - color: const Color(0xFF202020), + borderRadius: BorderRadius.circular(12), + color: CustomTheme.buttonBackgroundColor, onPressed: () async { if (await _showKamikazeSheet(context)) { if (!context.mounted) return; @@ -260,7 +261,7 @@ class _RoundViewState extends State { return Container( height: 80, padding: const EdgeInsets.only(bottom: 20), - color: CustomTheme.backgroundTintColor, + color: CustomTheme.mainElementbackgroundColor, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ diff --git a/lib/presentation/views/tab_view.dart b/lib/presentation/views/tab_view.dart index 0c98cc7..360737c 100644 --- a/lib/presentation/views/tab_view.dart +++ b/lib/presentation/views/tab_view.dart @@ -17,7 +17,7 @@ class _TabViewState extends State { Widget build(BuildContext context) { return CupertinoTabScaffold( tabBar: CupertinoTabBar( - backgroundColor: CustomTheme.backgroundTintColor, + backgroundColor: CustomTheme.mainElementbackgroundColor, iconSize: 27, height: 55, items: [ diff --git a/pubspec.yaml b/pubspec.yaml index d9cb654..37af518 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.4.9+529 +version: 0.4.9+533 environment: sdk: ^3.5.4 From f17eac14b9bcd47caa2daf2323ea949e3121bea2 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 18:06:38 +0200 Subject: [PATCH 11/11] Changed var name --- lib/core/custom_theme.dart | 2 +- lib/presentation/views/round_view.dart | 4 ++-- lib/presentation/views/tab_view.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/custom_theme.dart b/lib/core/custom_theme.dart index e123779..bfc4f3c 100644 --- a/lib/core/custom_theme.dart +++ b/lib/core/custom_theme.dart @@ -4,7 +4,7 @@ class CustomTheme { static Color white = CupertinoColors.white; static Color primaryColor = CupertinoColors.systemGreen; static Color backgroundColor = const Color(0xFF101010); - static Color mainElementbackgroundColor = CupertinoColors.darkBackgroundGray; + static Color mainElementBackgroundColor = CupertinoColors.darkBackgroundGray; static Color playerTileColor = CupertinoColors.secondaryLabel; static Color buttonBackgroundColor = const Color(0xFF202020); diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index 82af6dc..f99380e 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -118,7 +118,7 @@ class _RoundViewState extends State { height: 60, child: CupertinoSegmentedControl( unselectedColor: - CustomTheme.mainElementbackgroundColor, + CustomTheme.mainElementBackgroundColor, selectedColor: CustomTheme.primaryColor, groupValue: _caboPlayerIndex, children: Map.fromEntries(widget.gameSession.players @@ -261,7 +261,7 @@ class _RoundViewState extends State { return Container( height: 80, padding: const EdgeInsets.only(bottom: 20), - color: CustomTheme.mainElementbackgroundColor, + color: CustomTheme.mainElementBackgroundColor, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ diff --git a/lib/presentation/views/tab_view.dart b/lib/presentation/views/tab_view.dart index 360737c..4b757fa 100644 --- a/lib/presentation/views/tab_view.dart +++ b/lib/presentation/views/tab_view.dart @@ -17,7 +17,7 @@ class _TabViewState extends State { Widget build(BuildContext context) { return CupertinoTabScaffold( tabBar: CupertinoTabBar( - backgroundColor: CustomTheme.mainElementbackgroundColor, + backgroundColor: CustomTheme.mainElementBackgroundColor, iconSize: 27, height: 55, items: [