From c8de78ee77759bae62dbb23011f9d3b3f795d8f4 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 18 Jul 2025 23:25:20 +0200 Subject: [PATCH 01/15] Implemented first version of point overview --- lib/presentation/views/active_game_view.dart | 13 +++ .../views/point_overview_view.dart | 93 +++++++++++++++++++ pubspec.yaml | 2 +- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 lib/presentation/views/point_overview_view.dart diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index ab07804..eeae49d 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -4,6 +4,7 @@ import 'package:cabo_counter/data/game_session.dart'; import 'package:cabo_counter/l10n/generated/app_localizations.dart'; import 'package:cabo_counter/presentation/views/create_game_view.dart'; import 'package:cabo_counter/presentation/views/graph_view.dart'; +import 'package:cabo_counter/presentation/views/point_overview_view.dart'; import 'package:cabo_counter/presentation/views/round_view.dart'; import 'package:cabo_counter/services/local_storage_service.dart'; import 'package:flutter/cupertino.dart'; @@ -135,6 +136,18 @@ class _ActiveGameViewState extends State { builder: (_) => GraphView( gameSession: gameSession, )))), + CupertinoListTile( + title: Text( + 'Übersicht', + ), + backgroundColorActivated: + CustomTheme.backgroundColor, + onTap: () => Navigator.push( + context, + CupertinoPageRoute( + builder: (_) => PointOverviewView( + gameSession: gameSession, + )))), Visibility( visible: !gameSession.isPointsLimitEnabled, child: CupertinoListTile( diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart new file mode 100644 index 0000000..f8e15ea --- /dev/null +++ b/lib/presentation/views/point_overview_view.dart @@ -0,0 +1,93 @@ +import 'package:cabo_counter/data/game_session.dart'; +import 'package:cabo_counter/l10n/generated/app_localizations.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PointOverviewView extends StatefulWidget { + final GameSession gameSession; + + const PointOverviewView({super.key, required this.gameSession}); + + @override + State createState() => _PointOverviewViewState(); +} + +class _PointOverviewViewState extends State { + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + resizeToAvoidBottomInset: true, + navigationBar: CupertinoNavigationBar( + middle: const Text('Punkte-Übersicht'), + previousPageTitle: AppLocalizations.of(context).back, + ), + child: SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 5.0), + child: DataTable( + dataRowMinHeight: 60, + dataRowMaxHeight: 60, + dividerThickness: 0.5, + columnSpacing: 20, + columns: [ + const DataColumn(label: Text('#')), + ...widget.gameSession.players.map( + (player) => DataColumn(label: Text(player)), + ), + ], + rows: List.generate( + widget.gameSession.roundList.length, + (roundIndex) { + final round = widget.gameSession.roundList[roundIndex]; + return DataRow( + cells: [ + DataCell(Align( + alignment: Alignment.center, + child: Text( + '$roundIndex', + style: const TextStyle( + fontWeight: FontWeight.bold, fontSize: 20), + ), + )), + ...List.generate(widget.gameSession.players.length, + (playerIndex) { + final score = round.scores[playerIndex]; + final update = round.scoreUpdates[playerIndex]; + return DataCell( + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: update <= 0 + ? Colors.green[200] + : Colors.red[200], + borderRadius: BorderRadius.circular(8), + ), + child: Text( + '${update >= 0 ? '+' : '-'}$update', + style: TextStyle( + color: update <= 0 + ? Colors.green[900] + : Colors.red[900], + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 4), + Text('$score'), + ], + ), + ); + }), + ], + ); + }, + ), + ), + ))); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index a29cba1..07b2551 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.7+512 +version: 0.4.7+513 environment: sdk: ^3.5.4 From 5b418817b20c9078fc95c501bded0c38f9d66f25 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 18 Jul 2025 23:41:09 +0200 Subject: [PATCH 02/15] Visual improvements on table --- .../views/point_overview_view.dart | 78 ++++++++++++------- 1 file changed, 51 insertions(+), 27 deletions(-) diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart index f8e15ea..38d74c6 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/point_overview_view.dart @@ -1,3 +1,4 @@ +import 'package:cabo_counter/core/custom_theme.dart'; import 'package:cabo_counter/data/game_session.dart'; import 'package:cabo_counter/l10n/generated/app_localizations.dart'; import 'package:flutter/cupertino.dart'; @@ -24,16 +25,32 @@ class _PointOverviewViewState extends State { child: SingleChildScrollView( padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 5.0), + padding: const EdgeInsets.symmetric(horizontal: 8.0), child: DataTable( dataRowMinHeight: 60, dataRowMaxHeight: 60, dividerThickness: 0.5, columnSpacing: 20, columns: [ - const DataColumn(label: Text('#')), + const DataColumn( + numeric: true, + headingRowAlignment: MainAxisAlignment.center, + label: Text( + '#', + style: TextStyle(fontWeight: FontWeight.bold), + ), + columnWidth: IntrinsicColumnWidth(flex: 0.5)), ...widget.gameSession.players.map( - (player) => DataColumn(label: Text(player)), + (player) => DataColumn( + label: FittedBox( + fit: BoxFit.fill, + child: Text( + player, + style: + const TextStyle(fontWeight: FontWeight.bold), + )), + headingRowAlignment: MainAxisAlignment.center, + columnWidth: const IntrinsicColumnWidth(flex: 1)), ), ], rows: List.generate( @@ -46,40 +63,47 @@ class _PointOverviewViewState extends State { alignment: Alignment.center, child: Text( '$roundIndex', - style: const TextStyle( - fontWeight: FontWeight.bold, fontSize: 20), + style: const TextStyle(fontSize: 20), ), )), ...List.generate(widget.gameSession.players.length, (playerIndex) { final score = round.scores[playerIndex]; final update = round.scoreUpdates[playerIndex]; + final saidCabo = round.caboPlayerIndex == playerIndex + ? true + : false; return DataCell( - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: const EdgeInsets.symmetric( - horizontal: 6, vertical: 2), - decoration: BoxDecoration( - color: update <= 0 - ? Colors.green[200] - : Colors.red[200], - borderRadius: BorderRadius.circular(8), - ), - child: Text( - '${update >= 0 ? '+' : '-'}$update', - style: TextStyle( + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, vertical: 2), + decoration: BoxDecoration( color: update <= 0 - ? Colors.green[900] - : Colors.red[900], - fontWeight: FontWeight.bold, + ? CustomTheme.primaryColor + : CupertinoColors.destructiveRed, + borderRadius: BorderRadius.circular(8), + ), + child: Text( + '${update >= 0 ? '+' : '-'}$update', + style: const TextStyle( + color: CupertinoColors.white, + fontWeight: FontWeight.bold, + ), ), ), - ), - const SizedBox(height: 4), - Text('$score'), - ], + const SizedBox(height: 4), + Text('$score', + style: TextStyle( + fontWeight: saidCabo + ? FontWeight.bold + : FontWeight.normal, + )), + ], + ), ), ); }), From 0d9c8a99cd3647931b059afd37d210258dfafeb0 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 00:05:44 +0200 Subject: [PATCH 03/15] Added details and sum row --- .../views/point_overview_view.dart | 205 ++++++++++-------- pubspec.yaml | 2 +- 2 files changed, 116 insertions(+), 91 deletions(-) diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart index 38d74c6..fe6373a 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/point_overview_view.dart @@ -17,101 +17,126 @@ class _PointOverviewViewState extends State { @override Widget build(BuildContext context) { return CupertinoPageScaffold( - resizeToAvoidBottomInset: true, - navigationBar: CupertinoNavigationBar( - middle: const Text('Punkte-Übersicht'), - previousPageTitle: AppLocalizations.of(context).back, - ), - child: SingleChildScrollView( - padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: DataTable( - dataRowMinHeight: 60, - dataRowMaxHeight: 60, - dividerThickness: 0.5, - columnSpacing: 20, - columns: [ - const DataColumn( - numeric: true, - headingRowAlignment: MainAxisAlignment.center, - label: Text( - '#', - style: TextStyle(fontWeight: FontWeight.bold), - ), - columnWidth: IntrinsicColumnWidth(flex: 0.5)), - ...widget.gameSession.players.map( - (player) => DataColumn( - label: FittedBox( - fit: BoxFit.fill, - child: Text( - player, - style: - const TextStyle(fontWeight: FontWeight.bold), - )), - headingRowAlignment: MainAxisAlignment.center, - columnWidth: const IntrinsicColumnWidth(flex: 1)), + resizeToAvoidBottomInset: true, + navigationBar: CupertinoNavigationBar( + middle: const Text('Punkte-Übersicht'), + previousPageTitle: AppLocalizations.of(context).back, + ), + child: SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: DataTable( + dataRowMinHeight: 60, + dataRowMaxHeight: 60, + dividerThickness: 0.5, + columnSpacing: 20, + columns: [ + const DataColumn( + numeric: true, + headingRowAlignment: MainAxisAlignment.center, + label: Text( + '#', + style: TextStyle(fontWeight: FontWeight.bold), ), - ], - rows: List.generate( - widget.gameSession.roundList.length, - (roundIndex) { - final round = widget.gameSession.roundList[roundIndex]; - return DataRow( - cells: [ - DataCell(Align( - alignment: Alignment.center, - child: Text( - '$roundIndex', - style: const TextStyle(fontSize: 20), - ), + columnWidth: IntrinsicColumnWidth(flex: 0.5)), + ...widget.gameSession.players.map( + (player) => DataColumn( + label: FittedBox( + fit: BoxFit.fill, + child: Text( + player, + style: const TextStyle(fontWeight: FontWeight.bold), )), - ...List.generate(widget.gameSession.players.length, - (playerIndex) { - final score = round.scores[playerIndex]; - final update = round.scoreUpdates[playerIndex]; - final saidCabo = round.caboPlayerIndex == playerIndex - ? true - : false; - return DataCell( - Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: const EdgeInsets.symmetric( - horizontal: 6, vertical: 2), - decoration: BoxDecoration( - color: update <= 0 - ? CustomTheme.primaryColor - : CupertinoColors.destructiveRed, - borderRadius: BorderRadius.circular(8), - ), - child: Text( - '${update >= 0 ? '+' : '-'}$update', - style: const TextStyle( - color: CupertinoColors.white, - fontWeight: FontWeight.bold, - ), + headingRowAlignment: MainAxisAlignment.center, + columnWidth: const IntrinsicColumnWidth(flex: 1)), + ), + ], + rows: [ + ...List.generate( + widget.gameSession.roundList.length, + (roundIndex) { + final round = widget.gameSession.roundList[roundIndex]; + return DataRow( + cells: [ + DataCell(Align( + alignment: Alignment.center, + child: Text( + '$roundIndex', + style: const TextStyle(fontSize: 20), + ), + )), + ...List.generate(widget.gameSession.players.length, + (playerIndex) { + final score = round.scores[playerIndex]; + final update = round.scoreUpdates[playerIndex]; + final saidCabo = + round.caboPlayerIndex == playerIndex ? true : false; + return DataCell( + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: update <= 0 + ? CustomTheme.primaryColor + : CupertinoColors.destructiveRed, + borderRadius: BorderRadius.circular(8), + ), + child: Text( + '${update >= 0 ? '+' : '-'}$update', + style: const TextStyle( + color: CupertinoColors.white, + fontWeight: FontWeight.bold, ), ), - const SizedBox(height: 4), - Text('$score', - style: TextStyle( - fontWeight: saidCabo - ? FontWeight.bold - : FontWeight.normal, - )), - ], - ), + ), + const SizedBox(height: 4), + Text('$score', + style: TextStyle( + fontWeight: saidCabo + ? FontWeight.bold + : FontWeight.normal, + )), + ], ), - ); - }), - ], - ); - }, - ), + ), + ); + }), + ], + ); + }, ), - ))); + DataRow( + cells: [ + const DataCell(Align( + alignment: Alignment.center, + child: Text( + 'Σ', + style: + TextStyle(fontSize: 25, fontWeight: FontWeight.bold), + ), + )), + ...widget.gameSession.playerScores.map( + (score) => DataCell( + Center( + child: Text( + '$score', + style: const TextStyle( + fontSize: 20, fontWeight: FontWeight.bold), + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 07b2551..817731d 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.7+513 +version: 0.4.7+515 environment: sdk: ^3.5.4 From c461cd0b2a33f90cdbbcca7312162ab5a09671b1 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:06:02 +0200 Subject: [PATCH 04/15] Updated strings --- lib/l10n/arb/app_de.arb | 2 +- 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 +++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index 93215ed..534a35c 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -92,7 +92,6 @@ } }, - "end_game": "Spiel beenden", "delete_game": "Spiel löschen", "new_game_same_settings": "Neues Spiel mit gleichen Einstellungen", @@ -102,6 +101,7 @@ "end_game_title": "Spiel beenden?", "end_game_message": "Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.", + "table": "Punkteübersicht", "game_process": "Spielverlauf", "empty_graph_text": "Du musst mindestens eine Runde spielen, damit der Graph des Spielverlaufes angezeigt werden kann.", diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 8a327a5..d0a19c5 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -102,6 +102,7 @@ "end_game_title": "End the game?", "end_game_message": "Do you want to end the game? The game gets marked as finished and cannot be continued.", + "table": "Point Overview", "game_process": "Scoring History", "empty_graph_text": "You must play at least one round for the game progress graph to be displayed.", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index 0a902f6..ab51d4f 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -477,6 +477,12 @@ abstract class AppLocalizations { /// **'Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.'** String get end_game_message; + /// No description provided for @table. + /// + /// In de, this message translates to: + /// **'Punkteübersicht'** + String get table; + /// No description provided for @game_process. /// /// 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 7a71d00..9e25d98 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -221,6 +221,9 @@ class AppLocalizationsDe extends AppLocalizations { String get end_game_message => 'Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.'; + @override + String get table => 'Punkteübersicht'; + @override String get game_process => 'Spielverlauf'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 440d9cd..eb29acb 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -219,6 +219,9 @@ class AppLocalizationsEn extends AppLocalizations { String get end_game_message => 'Do you want to end the game? The game gets marked as finished and cannot be continued.'; + @override + String get table => 'Point Overview'; + @override String get game_process => 'Scoring History'; From 4bc3f65c712f2eb4f17fb3a5669556c2bb63605a Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:06:15 +0200 Subject: [PATCH 05/15] Implemented new strings --- lib/presentation/views/active_game_view.dart | 2 +- lib/presentation/views/point_overview_view.dart | 3 +-- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index eeae49d..6bbf6bc 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -138,7 +138,7 @@ class _ActiveGameViewState extends State { )))), CupertinoListTile( title: Text( - 'Übersicht', + AppLocalizations.of(context).table, ), backgroundColorActivated: CustomTheme.backgroundColor, diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart index fe6373a..31ea295 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/point_overview_view.dart @@ -17,9 +17,8 @@ class _PointOverviewViewState extends State { @override Widget build(BuildContext context) { return CupertinoPageScaffold( - resizeToAvoidBottomInset: true, navigationBar: CupertinoNavigationBar( - middle: const Text('Punkte-Übersicht'), + middle: Text(AppLocalizations.of(context).table), previousPageTitle: AppLocalizations.of(context).back, ), child: SingleChildScrollView( diff --git a/pubspec.yaml b/pubspec.yaml index 817731d..e800775 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.7+515 +version: 0.4.7+519 environment: sdk: ^3.5.4 From 61d10d7164f2cb56180e07c379f88493dbc79947 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:07:09 +0200 Subject: [PATCH 06/15] Refactoring --- lib/l10n/arb/app_de.arb | 4 ++-- lib/l10n/arb/app_en.arb | 4 ++-- lib/l10n/generated/app_localizations.dart | 8 ++++---- lib/l10n/generated/app_localizations_de.dart | 4 ++-- lib/l10n/generated/app_localizations_en.dart | 4 ++-- lib/presentation/views/active_game_view.dart | 4 ++-- lib/presentation/views/graph_view.dart | 2 +- lib/presentation/views/point_overview_view.dart | 2 +- pubspec.yaml | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index 534a35c..037050a 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -101,8 +101,8 @@ "end_game_title": "Spiel beenden?", "end_game_message": "Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.", - "table": "Punkteübersicht", - "game_process": "Spielverlauf", + "point_overview": "Punkteübersicht", + "scoring_history": "Spielverlauf", "empty_graph_text": "Du musst mindestens eine Runde spielen, damit der Graph des Spielverlaufes angezeigt werden kann.", "settings": "Einstellungen", diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index d0a19c5..d35978c 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -102,8 +102,8 @@ "end_game_title": "End the game?", "end_game_message": "Do you want to end the game? The game gets marked as finished and cannot be continued.", - "table": "Point Overview", - "game_process": "Scoring History", + "point_overview": "Point Overview", + "scoring_history": "Scoring History", "empty_graph_text": "You must play at least one round for the game progress graph to be displayed.", "settings": "Settings", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index ab51d4f..97f8ebb 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -477,17 +477,17 @@ abstract class AppLocalizations { /// **'Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.'** String get end_game_message; - /// No description provided for @table. + /// No description provided for @point_overview. /// /// In de, this message translates to: /// **'Punkteübersicht'** - String get table; + String get point_overview; - /// No description provided for @game_process. + /// No description provided for @scoring_history. /// /// In de, this message translates to: /// **'Spielverlauf'** - String get game_process; + String get scoring_history; /// No description provided for @empty_graph_text. /// diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index 9e25d98..6f45f13 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -222,10 +222,10 @@ class AppLocalizationsDe extends AppLocalizations { 'Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.'; @override - String get table => 'Punkteübersicht'; + String get point_overview => 'Punkteübersicht'; @override - String get game_process => 'Spielverlauf'; + String get scoring_history => 'Spielverlauf'; @override String get empty_graph_text => diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index eb29acb..5bdc175 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -220,10 +220,10 @@ class AppLocalizationsEn extends AppLocalizations { 'Do you want to end the game? The game gets marked as finished and cannot be continued.'; @override - String get table => 'Point Overview'; + String get point_overview => 'Point Overview'; @override - String get game_process => 'Scoring History'; + String get scoring_history => 'Scoring History'; @override String get empty_graph_text => diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index 6bbf6bc..280ae2c 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -126,7 +126,7 @@ class _ActiveGameViewState extends State { children: [ CupertinoListTile( title: Text( - AppLocalizations.of(context).game_process, + AppLocalizations.of(context).scoring_history, ), backgroundColorActivated: CustomTheme.backgroundColor, @@ -138,7 +138,7 @@ class _ActiveGameViewState extends State { )))), CupertinoListTile( title: Text( - AppLocalizations.of(context).table, + AppLocalizations.of(context).point_overview, ), backgroundColorActivated: CustomTheme.backgroundColor, diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index d322bd0..043eaa3 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -27,7 +27,7 @@ class _GraphViewState extends State { Widget build(BuildContext context) { return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( - middle: Text(AppLocalizations.of(context).game_process), + middle: Text(AppLocalizations.of(context).scoring_history), previousPageTitle: AppLocalizations.of(context).back, ), child: widget.gameSession.roundNumber > 1 diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart index 31ea295..3f1f5d0 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/point_overview_view.dart @@ -18,7 +18,7 @@ class _PointOverviewViewState extends State { Widget build(BuildContext context) { return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( - middle: Text(AppLocalizations.of(context).table), + middle: Text(AppLocalizations.of(context).point_overview), previousPageTitle: AppLocalizations.of(context).back, ), child: SingleChildScrollView( diff --git a/pubspec.yaml b/pubspec.yaml index e800775..a00e5a1 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.7+519 +version: 0.4.7+520 environment: sdk: ^3.5.4 From d3374b8b8cf9daa44de800060c546ba5389f668b Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:15:53 +0200 Subject: [PATCH 07/15] Updated graph displayment --- lib/presentation/views/graph_view.dart | 14 +++++++++++++- pubspec.yaml | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index 043eaa3..23137cd 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -34,17 +34,29 @@ class _GraphViewState extends State { ? Padding( padding: const EdgeInsets.fromLTRB(0, 100, 0, 0), child: SfCartesianChart( + enableAxisAnimation: true, legend: const Legend( overflowMode: LegendItemOverflowMode.wrap, isVisible: true, position: LegendPosition.bottom), primaryXAxis: const NumericAxis( + labelStyle: TextStyle(fontWeight: FontWeight.bold), interval: 1, decimalPlaces: 0, ), - primaryYAxis: const NumericAxis( + primaryYAxis: NumericAxis( + labelStyle: const TextStyle(fontWeight: FontWeight.bold), + labelAlignment: LabelAlignment.center, + labelPosition: ChartDataLabelPosition.inside, interval: 1, decimalPlaces: 0, + axisLabelFormatter: (AxisLabelRenderDetails details) { + if (details.value == 0) { + return ChartAxisLabel('', const TextStyle()); + } + return ChartAxisLabel( + '${details.value.toInt()}', const TextStyle()); + }, ), series: getCumulativeScores(), ), diff --git a/pubspec.yaml b/pubspec.yaml index a00e5a1..e00e46a 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.7+520 +version: 0.4.7+521 environment: sdk: ^3.5.4 From 3b29014d290a4f5e1dd776075d8c1fa7abd87719 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:33:17 +0200 Subject: [PATCH 08/15] Moved new views to statistics section --- 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/active_game_view.dart | 13 ++++++++++++- 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index 037050a..399aefd 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -101,6 +101,7 @@ "end_game_title": "Spiel beenden?", "end_game_message": "Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.", + "statistics": "Statistiken", "point_overview": "Punkteübersicht", "scoring_history": "Spielverlauf", "empty_graph_text": "Du musst mindestens eine Runde spielen, damit der Graph des Spielverlaufes angezeigt werden kann.", diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index d35978c..4d067ad 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -102,6 +102,7 @@ "end_game_title": "End the game?", "end_game_message": "Do you want to end the game? The game gets marked as finished and cannot be continued.", + "statistics": "Statistics", "point_overview": "Point Overview", "scoring_history": "Scoring History", "empty_graph_text": "You must play at least one round for the game progress graph to be displayed.", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index 97f8ebb..7ce3c52 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -477,6 +477,12 @@ abstract class AppLocalizations { /// **'Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.'** String get end_game_message; + /// No description provided for @statistics. + /// + /// In de, this message translates to: + /// **'Statistiken'** + String get statistics; + /// No description provided for @point_overview. /// /// 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 6f45f13..6539c20 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -221,6 +221,9 @@ class AppLocalizationsDe extends AppLocalizations { String get end_game_message => 'Möchtest du das Spiel beenden? Das Spiel wird als beendet markiert und kann nicht fortgeführt werden.'; + @override + String get statistics => 'Statistiken'; + @override String get point_overview => 'Punkteübersicht'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 5bdc175..7e026f6 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -219,6 +219,9 @@ class AppLocalizationsEn extends AppLocalizations { String get end_game_message => 'Do you want to end the game? The game gets marked as finished and cannot be continued.'; + @override + String get statistics => 'Statistics'; + @override String get point_overview => 'Point Overview'; diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index 280ae2c..7b88608 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -118,7 +118,7 @@ class _ActiveGameViewState extends State { Padding( padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), child: Text( - AppLocalizations.of(context).game, + AppLocalizations.of(context).statistics, style: CustomTheme.rowTitle, ), ), @@ -148,6 +148,17 @@ class _ActiveGameViewState extends State { builder: (_) => PointOverviewView( gameSession: gameSession, )))), + ], + ), + Padding( + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), + child: Text( + AppLocalizations.of(context).game, + style: CustomTheme.rowTitle, + ), + ), + Column( + children: [ Visibility( visible: !gameSession.isPointsLimitEnabled, child: CupertinoListTile( From 039dfffb5449c00414bbc5a4172a939849204661 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:33:31 +0200 Subject: [PATCH 09/15] Added seperator in main menu --- lib/presentation/views/main_menu_view.dart | 9 ++++++++- pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/presentation/views/main_menu_view.dart b/lib/presentation/views/main_menu_view.dart index 1a818b6..a80664d 100644 --- a/lib/presentation/views/main_menu_view.dart +++ b/lib/presentation/views/main_menu_view.dart @@ -118,8 +118,15 @@ class _MainMenuViewState extends State { ), ], ) - : ListView.builder( + : ListView.separated( itemCount: gameManager.gameList.length, + separatorBuilder: (context, index) => Divider( + height: 1, + thickness: 0.5, + color: CustomTheme.white.withAlpha(50), + indent: 50, + endIndent: 50, + ), itemBuilder: (context, index) { final session = gameManager.gameList[index]; return ListenableBuilder( diff --git a/pubspec.yaml b/pubspec.yaml index e00e46a..9f58ea5 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.7+521 +version: 0.4.8+522 environment: sdk: ^3.5.4 From 1cf7fdbac39867424107cc3cbe0c44fea8e8ef31 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:44:54 +0200 Subject: [PATCH 10/15] Renaming --- lib/presentation/views/point_overview_view.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart index 3f1f5d0..f80b9b7 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/point_overview_view.dart @@ -54,14 +54,14 @@ class _PointOverviewViewState extends State { rows: [ ...List.generate( widget.gameSession.roundList.length, - (roundIndex) { - final round = widget.gameSession.roundList[roundIndex]; + (roundNumber) { + final round = widget.gameSession.roundList[roundNumber]; return DataRow( cells: [ DataCell(Align( alignment: Alignment.center, child: Text( - '$roundIndex', + '$roundNumber', style: const TextStyle(fontSize: 20), ), )), From d9c0d40ff2286e88a446765996004e49e4d742aa Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:46:25 +0200 Subject: [PATCH 11/15] Updated sign --- lib/presentation/views/point_overview_view.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/point_overview_view.dart index f80b9b7..0abdaac 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/point_overview_view.dart @@ -86,7 +86,7 @@ class _PointOverviewViewState extends State { borderRadius: BorderRadius.circular(8), ), child: Text( - '${update >= 0 ? '+' : '-'}$update', + '${update >= 0 ? '+' : ''}$update', style: const TextStyle( color: CupertinoColors.white, fontWeight: FontWeight.bold, diff --git a/pubspec.yaml b/pubspec.yaml index 9f58ea5..63ab04c 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+522 +version: 0.4.8+523 environment: sdk: ^3.5.4 From 5a775dafd946b1d001515f4e24f704e22c0e35d5 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:51:28 +0200 Subject: [PATCH 12/15] Updated colors & class name --- lib/core/custom_theme.dart | 4 ++++ lib/presentation/views/active_game_view.dart | 4 ++-- .../{point_overview_view.dart => points_view.dart} | 12 ++++++------ pubspec.yaml | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) rename lib/presentation/views/{point_overview_view.dart => points_view.dart} (93%) diff --git a/lib/core/custom_theme.dart b/lib/core/custom_theme.dart index a00340b..fa78cb6 100644 --- a/lib/core/custom_theme.dart +++ b/lib/core/custom_theme.dart @@ -13,6 +13,10 @@ class CustomTheme { static const Color graphColor4 = Color(0xFF9C27B0); static final Color graphColor5 = primaryColor; + // Colors for PointsView + static Color pointLossColor = primaryColor; + static const Color pointGainColor = Color(0xFFF44336); + static TextStyle modeTitle = TextStyle( color: primaryColor, fontSize: 20, diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index 7b88608..defe5fc 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -4,7 +4,7 @@ import 'package:cabo_counter/data/game_session.dart'; import 'package:cabo_counter/l10n/generated/app_localizations.dart'; import 'package:cabo_counter/presentation/views/create_game_view.dart'; import 'package:cabo_counter/presentation/views/graph_view.dart'; -import 'package:cabo_counter/presentation/views/point_overview_view.dart'; +import 'package:cabo_counter/presentation/views/points_view.dart'; import 'package:cabo_counter/presentation/views/round_view.dart'; import 'package:cabo_counter/services/local_storage_service.dart'; import 'package:flutter/cupertino.dart'; @@ -145,7 +145,7 @@ class _ActiveGameViewState extends State { onTap: () => Navigator.push( context, CupertinoPageRoute( - builder: (_) => PointOverviewView( + builder: (_) => PointsView( gameSession: gameSession, )))), ], diff --git a/lib/presentation/views/point_overview_view.dart b/lib/presentation/views/points_view.dart similarity index 93% rename from lib/presentation/views/point_overview_view.dart rename to lib/presentation/views/points_view.dart index 0abdaac..555d5bd 100644 --- a/lib/presentation/views/point_overview_view.dart +++ b/lib/presentation/views/points_view.dart @@ -4,16 +4,16 @@ import 'package:cabo_counter/l10n/generated/app_localizations.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class PointOverviewView extends StatefulWidget { +class PointsView extends StatefulWidget { final GameSession gameSession; - const PointOverviewView({super.key, required this.gameSession}); + const PointsView({super.key, required this.gameSession}); @override - State createState() => _PointOverviewViewState(); + State createState() => _PointsViewState(); } -class _PointOverviewViewState extends State { +class _PointsViewState extends State { @override Widget build(BuildContext context) { return CupertinoPageScaffold( @@ -81,8 +81,8 @@ class _PointOverviewViewState extends State { horizontal: 6, vertical: 2), decoration: BoxDecoration( color: update <= 0 - ? CustomTheme.primaryColor - : CupertinoColors.destructiveRed, + ? CustomTheme.pointLossColor + : CustomTheme.pointGainColor, borderRadius: BorderRadius.circular(8), ), child: Text( diff --git a/pubspec.yaml b/pubspec.yaml index 63ab04c..7f8483c 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+523 +version: 0.4.8+525 environment: sdk: ^3.5.4 From 12b4d3d74102f01497af0e1c1ebeb428924848b9 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:52:09 +0200 Subject: [PATCH 13/15] Removed empty line --- lib/l10n/arb/app_en.arb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 4d067ad..3b6150a 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -92,7 +92,6 @@ } }, - "end_game": "End Game", "delete_game": "Delete Game", "new_game_same_settings": "New Game with same Settings", From 65d44ac7b13f3149ff7a504544e908abd5b303d1 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:56:48 +0200 Subject: [PATCH 14/15] Updated round index --- lib/presentation/views/points_view.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/presentation/views/points_view.dart b/lib/presentation/views/points_view.dart index 555d5bd..4e0cded 100644 --- a/lib/presentation/views/points_view.dart +++ b/lib/presentation/views/points_view.dart @@ -54,14 +54,14 @@ class _PointsViewState extends State { rows: [ ...List.generate( widget.gameSession.roundList.length, - (roundNumber) { - final round = widget.gameSession.roundList[roundNumber]; + (roundIndex) { + final round = widget.gameSession.roundList[roundIndex]; return DataRow( cells: [ DataCell(Align( alignment: Alignment.center, child: Text( - '$roundNumber', + '${roundIndex + 1}', style: const TextStyle(fontSize: 20), ), )), From 91ba666521dcd07e2bb7115687a41864f8b951c2 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 19 Jul 2025 15:57:32 +0200 Subject: [PATCH 15/15] Updated types --- lib/presentation/views/points_view.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/presentation/views/points_view.dart b/lib/presentation/views/points_view.dart index 4e0cded..1379785 100644 --- a/lib/presentation/views/points_view.dart +++ b/lib/presentation/views/points_view.dart @@ -67,10 +67,10 @@ class _PointsViewState extends State { )), ...List.generate(widget.gameSession.players.length, (playerIndex) { - final score = round.scores[playerIndex]; - final update = round.scoreUpdates[playerIndex]; - final saidCabo = - round.caboPlayerIndex == playerIndex ? true : false; + final int score = round.scores[playerIndex]; + final int update = round.scoreUpdates[playerIndex]; + final bool saidCabo = + round.caboPlayerIndex == playerIndex; return DataCell( Center( child: Column(