From 7710646cd0b559a5a6cd95ff14e53f7ba1828626 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 27 Jun 2025 11:00:37 +0200 Subject: [PATCH] Added new Buttons and new GraphView --- lib/l10n/app_de.arb | 3 +++ lib/l10n/app_localizations.dart | 12 ++++++++++++ lib/l10n/app_localizations_de.dart | 6 ++++++ lib/l10n/app_localizations_en.dart | 14 ++++++++++---- lib/l10n/untranslated_messages.json | 7 ++++++- lib/views/active_game_view.dart | 25 +++++++++++++++++++++++++ lib/views/graph_view.dart | 22 ++++++++++++++++++++++ pubspec.yaml | 2 +- 8 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 lib/views/graph_view.dart diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index c107f9a..4d2f85b 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -14,6 +14,7 @@ "player": "Spieler:in", "players": "Spieler:innen", "name": "Name", + "back": "Zurück", "home": "Home", "about": "Über", @@ -63,6 +64,8 @@ "done": "Fertig", "next_round": "Nächste Runde", + "game_statistics": "Spielstatistiken", + "settings": "Einstellungen", "cabo_penalty": "Cabo-Strafe", "cabo_penalty_subtitle": "... für falsches Cabo sagen", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index ac0b6a9..e6279c2 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -176,6 +176,12 @@ abstract class AppLocalizations { /// **'Name'** String get name; + /// No description provided for @back. + /// + /// In de, this message translates to: + /// **'Zurück'** + String get back; + /// No description provided for @home. /// /// In de, this message translates to: @@ -356,6 +362,12 @@ abstract class AppLocalizations { /// **'Nächste Runde'** String get next_round; + /// No description provided for @game_statistics. + /// + /// In de, this message translates to: + /// **'Spielstatistiken'** + String get game_statistics; + /// No description provided for @settings. /// /// In de, this message translates to: diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index a3931c2..f6df27f 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -47,6 +47,9 @@ class AppLocalizationsDe extends AppLocalizations { @override String get name => 'Name'; + @override + String get back => 'Zurück'; + @override String get home => 'Home'; @@ -146,6 +149,9 @@ class AppLocalizationsDe extends AppLocalizations { @override String get next_round => 'Nächste Runde'; + @override + String get game_statistics => 'Spielstatistiken'; + @override String get settings => 'Einstellungen'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index f1958d4..07c3bba 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -47,6 +47,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get name => 'Name'; + @override + String get back => 'Zurück'; + @override String get home => 'Home'; @@ -58,7 +61,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get empty_text_2 => - 'Add a new round using the button in the top right corner'; + 'Add a new round using the button in the top right corner.'; @override String get delete_game_title => 'Delete game?'; @@ -143,6 +146,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get next_round => 'Next Round'; + @override + String get game_statistics => 'Spielstatistiken'; + @override String get settings => 'Settings'; @@ -150,13 +156,13 @@ class AppLocalizationsEn extends AppLocalizations { String get cabo_penalty => 'Cabo Penalty'; @override - String get cabo_penalty_subtitle => '... for falsely calling Cabo'; + String get cabo_penalty_subtitle => '... for falsely calling Cabo.'; @override String get point_limit => 'Point Limit'; @override - String get point_limit_subtitle => '... the game ends here'; + String get point_limit_subtitle => '... the game ends here.'; @override String get reset_to_default => 'Reset to Default'; @@ -196,5 +202,5 @@ class AppLocalizationsEn extends AppLocalizations { @override String get about_text => - 'Hey :) Thanks for being one of the first users of my first app! I’ve put a lot of work into this project, and even though I (hopefully) thought of a lot, not everything will work 100% yet. So if you discover any bugs or have feedback on the design or usability, please let me know via the Testflight app or a message / email. Thank you very much!'; + 'Hey :) Thanks for being one of the first users of my app! I’ve put a lot of work into this project, and even though I tried to think of everything, it might not work perfectly just yet. So if you discover any bugs or have feedback on the design or usability, please let me know via the TestFlight app or by sending me a message or email. Thank you very much!'; } diff --git a/lib/l10n/untranslated_messages.json b/lib/l10n/untranslated_messages.json index 9e26dfe..7c9f0f2 100644 --- a/lib/l10n/untranslated_messages.json +++ b/lib/l10n/untranslated_messages.json @@ -1 +1,6 @@ -{} \ No newline at end of file +{ + "en": [ + "back", + "game_statistics" + ] +} diff --git a/lib/views/active_game_view.dart b/lib/views/active_game_view.dart index 6899caf..c768eb2 100644 --- a/lib/views/active_game_view.dart +++ b/lib/views/active_game_view.dart @@ -1,8 +1,10 @@ import 'package:cabo_counter/data/game_session.dart'; import 'package:cabo_counter/l10n/app_localizations.dart'; import 'package:cabo_counter/utility/custom_theme.dart'; +import 'package:cabo_counter/views/graph_view.dart'; import 'package:cabo_counter/views/round_view.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class ActiveGameView extends StatefulWidget { final GameSession gameSession; @@ -107,6 +109,29 @@ class _ActiveGameViewState extends State { )); }, ), + Padding( + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), + child: Text( + AppLocalizations.of(context).game, + style: CustomTheme.rowTitle, + ), + ), + Column( + children: [ + CupertinoListTile( + title: const Text('Statistiken'), + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => const GraphView()))), + const CupertinoListTile(title: Text('Spiel löschen')), + const CupertinoListTile( + title: Text( + 'Neues Spiel mit gleichen Einstellungen')), + const CupertinoListTile( + title: Text('Spiel exportieren')), + ], + ) ], ), ), diff --git a/lib/views/graph_view.dart b/lib/views/graph_view.dart new file mode 100644 index 0000000..00dff72 --- /dev/null +++ b/lib/views/graph_view.dart @@ -0,0 +1,22 @@ +import 'package:cabo_counter/l10n/app_localizations.dart'; +import 'package:flutter/cupertino.dart'; + +class GraphView extends StatefulWidget { + const GraphView({super.key}); + + @override + State createState() => _GraphViewState(); +} + +class _GraphViewState extends State { + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + middle: Text(AppLocalizations.of(context).game_statistics), + previousPageTitle: AppLocalizations.of(context).back, + ), + child: const Center(child: Text('GraphView')), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index f61258f..ff80cad 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.1+237 +version: 0.3.1+239 environment: sdk: ^3.5.4