22 Commits

Author SHA1 Message Date
gelbeinhalb
867d0c55da update match_dao.dart
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m8s
Pull Request Pipeline / test (pull_request) Failing after 2m27s
2026-01-16 12:00:07 +01:00
gelbeinhalb
02d3220c1a add group_match_dao.dart 2026-01-16 11:57:50 +01:00
gelbeinhalb
3ca612b0a1 add description attribute to group_dao.dart 2026-01-16 11:56:47 +01:00
gelbeinhalb
cb66b76e5a add game_dao.dart 2026-01-16 11:55:47 +01:00
gelbeinhalb
b9b72cdd50 add pair
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m11s
Pull Request Pipeline / test (pull_request) Failing after 2m30s
2026-01-16 11:10:42 +01:00
gelbeinhalb
4a56df7f8f add team 2026-01-16 11:09:18 +01:00
gelbeinhalb
f2a12265ad add createdAt to team 2026-01-16 11:09:08 +01:00
gelbeinhalb
c82d72544e add description to player 2026-01-16 11:04:54 +01:00
gelbeinhalb
072021bd4c update match class 2026-01-16 10:50:03 +01:00
gelbeinhalb
6a9e5dc9eb add game.dart
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m8s
Pull Request Pipeline / test (pull_request) Failing after 2m29s
2026-01-16 10:28:55 +01:00
gelbeinhalb
be01b5f72a add description to group
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m10s
Pull Request Pipeline / test (pull_request) Failing after 2m29s
2026-01-12 12:51:25 +01:00
gelbeinhalb
e2fe0c7d4d remove group_match_dao
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m18s
Pull Request Pipeline / test (pull_request) Failing after 2m42s
2026-01-12 11:42:03 +01:00
gelbeinhalb
b72ab70e02 add score table
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m22s
Pull Request Pipeline / test (pull_request) Failing after 2m52s
2026-01-12 11:38:38 +01:00
gelbeinhalb
189daf76dd move createdAt below description 2026-01-12 11:35:57 +01:00
gelbeinhalb
0f987f4c7a move match below ids 2026-01-12 11:34:02 +01:00
gelbeinhalb
5dd8f31942 add description to group_table.dart
Some checks failed
Pull Request Pipeline / lint (pull_request) Failing after 2m29s
Pull Request Pipeline / test (pull_request) Failing after 2m54s
2026-01-12 11:33:00 +01:00
gelbeinhalb
0394f5edf9 delete group_match_table.dart 2026-01-12 11:32:23 +01:00
gelbeinhalb
d8abad6fd8 add groupid gameid and notes to match 2026-01-12 11:30:37 +01:00
gelbeinhalb
7e6c309de0 add game table 2026-01-12 11:26:39 +01:00
gelbeinhalb
3344575132 add team id and score
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m0s
Pull Request Pipeline / lint (pull_request) Successful in 2m8s
2026-01-12 11:20:40 +01:00
gelbeinhalb
9b66e58dc0 add team table 2026-01-12 11:17:13 +01:00
gelbeinhalb
56562b22bb add description to player 2026-01-12 11:16:02 +01:00
149 changed files with 1927 additions and 11429 deletions

View File

@@ -0,0 +1,35 @@
---
name: Bug report
about: Erstelle eine Meldung für etwas, das nicht Funktioniert, wie es soll.
title: ''
labels: 'Task/Bug'
assignees: ''
---
# Bug Report
## Beschreibung
[Eine klare und prägnante Beschreibung des Bugs]
## Schritte zur Reproduktion
1. Schritt 1
2. Schritt 2
3. ...
## Erwartetes Verhalten
[Was hätte passieren sollen]
## Tatsächliches Verhalten
[Was tatsächlich passiert ist]
## Screenshots/Protokolle
[Falls zutreffend, füge Screenshots, Error Logs oder Stack Traces hinzu]
## Umgebung
- Plattform: Android, iOS, Web
- OS: [z. B. iOS 18.5, Android 14]
- Flutter Version: [z.B. 3.35.6]
## Verwandte Issues
[Verweisen Sie auf ähnliche Issues oder PRs]

View File

@@ -0,0 +1,22 @@
---
name: Enhancement
about: Enhancements for current features
title: ''
labels: 'Task\Enhancement'
assignees: ''
---
# Enhancement
## Aktuelles Verhalten
[Beschreibe die bestehende Funktionalität]
## Einschränkungen/Probleme
[Was sind die aktuellen Mängel?]
## Vorgeschlagene Verbesserung
[Wie kann das Problem bzw. die Einschränkung verbessert werden?]
## Zugehörige Issues
[Links zu verwandten oder blockierenden Issues]

View File

@@ -0,0 +1,19 @@
---
name: Feature
about: Neues Feature für die App
title: ''
labels: 'Task\Feature'
assignees: ''
---
# Feature
## Beschreibung
[Ausführliche Erläuterung der vorgeschlagenen Funktion]
## Vorgeschlagene Lösung
[Beschreibe, wie die Feature funktionieren soll]
## Zugehörige Issues
[Links zu verwandten oder blockierenden Issues]

View File

@@ -0,0 +1,16 @@
# [PR Titel]
**Zugehörige Issue(s):**
Closes `<issue-no>`
## Beschreibung
*Eine klare und prägnante Übersicht über die vorgenommenen Änderungen. Erläutere nicht nur das was gemacht wurde, sondern auch warum.*
## Änderungen
- [ ] Neue Funktion X hinzugefügt
- [ ] Bug in Komponente Y behoben
- [ ] Modul Z für bessere Leistung refactored
- [ ] Dependencies aktualisiert
## Zusätzliche Anmerkungen
*Gibt es zusätzlichen Kontext, Einschränkungen oder Informationen, die Reviewer wissen sollten?*

View File

@@ -1,53 +0,0 @@
name: Bug Report
about: Erstelle eine Bug Report
labels: 'Task/Bug'
title: ''
body:
- type: textarea
id: description
attributes:
label: Beschreibung
description: Beschreibe klar und pregnant das Fehlerverhalten
placeholder: |
- Was genau ist das unerwünschte Verhalten?
- Welche Auswirkungen hat der Fehler?
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Schritte zur Reproduktion
description: Beschreibe, wie der Fehler reproduziert werden kann
placeholder: |
- 1. Schritt 1
- 2. Schritt 2
- 3. ...
- type: dropdown
id: enviroment
attributes:
label: Umgebung
description: Gebe an, auf welchen Platformen dieser Fehler auftritt
list: false
multiple: true
options: ['Android', 'iOS']
- type: textarea
id: solution
attributes:
label: Lösungsidee
description: Beschreibe, wie das Problem bzw. gelöst werden kann
placeholder: |
- Button X ändern, sodass ...
- Funktion X so erweitern, dass ...
- Design anpassen, sodass ...
- type: textarea
attributes:
label: Verwandte Issues
description: Verweise auf ähnliche Issues oder PRs
placeholder: |
- Knüpft an Issue #35 an
- Ersetzt Issue #12
- Brauch Implementierung von #43

View File

@@ -1,36 +0,0 @@
name: Enhancement
about: Erstelle ein Enhancement-Ticket
labels: 'Task/Enhancement'
title: ''
body:
- type: textarea
id: description
attributes:
label: Aktuelles Verhalten
description: Beschreibe, wie die Funktionalität aktuell gestaltet ist
placeholder: |
- Aktuell macht Button X folgendes ...
- Das Problem ist, dass ...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Vorgeschlagene Verbesserung
description: Beschreibe, wie das Problem bzw. die Einschränkung verbessert werden kann
placeholder: |
- Button X ändern, sodass ...
- Funktion X so erweitern, dass ...
- Design anpassen, sodass ...
validations:
required: true
- type: textarea
attributes:
label: Zugehörige Issues
description: Links zu verwandten oder blockierenden Issues
placeholder: |
- Knüpft an Issue #35 an
- Ersetzt Issue #12
- Brauch Implementierung von #43

View File

@@ -1,36 +0,0 @@
name: Feature
about: Erstelle ein Feature-Ticket
labels: 'Task/Feature'
title: ''
body:
- type: textarea
id: description
attributes:
label: Beschreibung
description: Ausführliche Erläuterung der vorgeschlagenen Funktion
placeholder: |
- Welchen Zweck erfüllt das Feature?
- Welches Problem löst das Feature?
- Wer profitiert davon?
- Warum ist es wichtig?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Vorgeschlagene Lösung
description: Beschreibe, wie das Feature funktionieren soll
placeholder: |
- Neues Widget, das folgendermaßen aussieht ...
- Neue Ansicht, die folgende Inhalte hat
- Neue Funktionsweise von Komponente XY
- type: textarea
attributes:
label: Zugehörige Issues
description: Links zu verwandten oder blockierenden Issues
placeholder: |
- Knüpft an Issue #35 an
- Ersetzt Issue #12
- Brauch Implementierung von #43

View File

@@ -1,47 +0,0 @@
name: Pull Request
about: Vorlage für Pull Requests
title: "WIP: [Name des Issues]"
body:
- type: input
id: related_issue
attributes:
label: Zugehörige Issue(s)
description: Issues welche mit diesem Pull Request geschlossen werden sollen
placeholder: "Closes #123"
validations:
required: true
- type: textarea
id: description
attributes:
label: Beschreibung
description: |
Eine klare und prägnante Zusammenfassung aller vorgenommenen Änderungen.
placeholder: |
Was wurde geändert?
validations:
required: true
- type: textarea
id: changes
attributes:
label: Änderungen
description: Liste alle Änderungen detailiert auf, die in diesem Pull Request vorgenommen wurden.
placeholder: |
- Neue Funktion X hinzugefügt
- Bug in Komponente X behoben
- Modul X für bessere Leistung refactored
- Dependencies aktualisiert
- type: textarea
id: additional_notes
attributes:
label: Zusätzliche Anmerkungen
description: |
Gibt es zusätzlichen Kontext, Einschränkungen oder Informationen,
die Reviewer wissen sollten?
placeholder: |
- Bekannte Einschränkungen
- Offene TODOs
- Hinweise für Reviewer

View File

@@ -10,22 +10,22 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Required for Flutter action
- name: Install jq - name: Install jq
run: | run: |
apt-get update apt-get update
apt-get install -y jq apt-get install -y jq
- name: Set up Flutter - name: Install Flutter (wget)
uses: subosito/flutter-action@v2 run: |
with: wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz
channel: stable tar xf flutter_linux_3.38.2-stable.tar.xz
flutter-version: 3.38.6 # Set Git safe directory for Flutter path
git config --global --add safe.directory "$(pwd)/flutter"
# Set Flutter path
echo "$(pwd)/flutter/bin" >> $GITHUB_PATH
- name: Get dependencies - name: Get dependencies
run: | run: flutter pub get
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.38.6-x64
flutter pub get
- name: Analyze Formatting - name: Analyze Formatting
run: flutter analyze lib test run: flutter analyze lib test
@@ -36,22 +36,22 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Required for Flutter action - name: Install dependencies
- name: Install jq
run: | run: |
apt-get update apt-get update
apt-get install -y jq apt-get install -y jq
- name: Set up Flutter - name: Install Flutter (wget)
uses: subosito/flutter-action@v2 run: |
with: wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz
channel: stable tar xf flutter_linux_3.38.2-stable.tar.xz
flutter-version: 3.38.6 # Set Git safe directory for Flutter path
git config --global --add safe.directory "$(pwd)/flutter"
# Set Flutter path
echo "$(pwd)/flutter/bin" >> $GITHUB_PATH
- name: Get dependencies - name: Get dependencies
run: | run: flutter pub get
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.38.6-x64
flutter pub get
- name: Run tests - name: Run tests
run: flutter test run: flutter test

View File

@@ -7,194 +7,44 @@ on:
- "main" - "main"
jobs: jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java (Temurin 17)
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
# Required for Flutter action
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.38.6
- name: Get dependencies
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.38.6-x64
flutter pub get
- name: Build APK
run: flutter build apk --release
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Required for Flutter action
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.38.6
- name: Get dependencies
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.38.6-x64
flutter pub get
- name: Run tests
run: flutter test
update_version:
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/development'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
ref: ${{ gitea.ref_name }}
- name: Increment version number
uses: stikkyapp/update-pubspec-version@v2
with:
strategy: 'patch'
path: './pubspec.yaml'
- name: Commit version update
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git config pull.rebase false
git pull origin ${{ gitea.ref_name }}
git add pubspec.yaml
git commit -m "Updated version number [skip ci]"
git push origin HEAD:${{ gitea.ref_name }}
generate_licenses:
runs-on: ubuntu-latest
needs: update_version
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
ref: ${{ gitea.ref_name }}
# Required for Flutter action
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.38.6
- name: Get dependencies
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.38.6-x64
flutter pub get
- name: Generate oss_licenses.dart
run: flutter pub run dart_pubspec_licenses:generate -o lib/presentation/views/main_menu/settings_view/licenses/oss_licenses.dart
- name: Commit license update
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
if [ -n "$(git status --porcelain lib test)" ]; then
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git config pull.rebase false
git pull origin ${{ gitea.ref_name }}
git add lib test
git commit -m "Updated licenses [skip ci]"
git push origin HEAD:${{ gitea.ref_name }}
else
echo "No changes to commit"
fi
format: format:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [update_version, generate_licenses] if: false # Needs bot user
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Required for Flutter action - name: Install dependencies
- name: Install jq
run: | run: |
apt-get update apt-get update
apt-get install -y jq apt-get install -y jq
- name: Set up Flutter - name: Install Flutter (wget)
uses: subosito/flutter-action@v2 run: |
with: wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz
channel: stable tar xf flutter_linux_3.38.2-stable.tar.xz
flutter-version: 3.38.6 # Set Git safe directory for Flutter path
git config --global --add safe.directory "$(pwd)/flutter"
- name: Get dependencies # Set Flutter path
echo "$(pwd)/flutter/bin" >> $GITHUB_PATH
- name: Get & upgrade dependencies
run: | run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.38.6-x64
flutter pub get flutter pub get
flutter pub upgrade --major-versions
- name: Check code format - name: Auto-format
id: check_format
continue-on-error: true
run: flutter analyze lib test
- name: Format code
if: steps.check_format.outcome == 'failure'
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
run: | run: |
git fetch origin ${{ gitea.ref_name }} dart format lib
git checkout ${{ gitea.ref_name }} dart fix --apply lib
dart fix --apply lib
dart fix --apply test
if [ -n "$(git status --porcelain lib test)" ]; then
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git config pull.rebase false
git pull origin ${{ gitea.ref_name }}
git add lib test
git commit -m "Auto-format code [skip ci]"
git push origin HEAD:${{ gitea.ref_name }}
else
echo "No changes to commit"
fi
- name: Verify format # Needs credentials, push access and the right files need to be staged
run: flutter analyze lib test - name: Commit Changes
run: |
git config --global user.name "Gitea Actions"
git config --global user.email "actions@gitea.com"
git status
git add lib/
git status
git commit -m "Actions: Auto-formatting [skip ci]"
git push

27
.gitignore vendored
View File

@@ -150,9 +150,25 @@ app.*.symbols
.gclient_previous_custom_vars .gclient_previous_custom_vars
.gclient_previous_sync_commits .gclient_previous_sync_commits
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/ .swiftpm/
migrate_working_dir/ migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in # The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line # VS Code which you may wish to be included in version control, so this line
@@ -160,8 +176,17 @@ migrate_working_dir/
#.vscode/ #.vscode/
# Flutter/Dart/Pub related # Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/ /build/
# Symbolication related
app.*.symbols
# Obfuscation related # Obfuscation related
app.*.map.json app.*.map.json
@@ -171,5 +196,3 @@ app.*.map.json
/android/app/profile /android/app/profile
/android/app/release /android/app/release
/devtools_options.yaml /devtools_options.yaml
untranslated_messages.json

View File

@@ -1,13 +0,0 @@
# Contributing
## Code of Conduct
`<insert link to code of conduct here>`
## Code Style
`<insert styling guidelines here>`
## Repository structure
`<insert folder structure and explanation here>`

165
LICENSE
View File

@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,63 +1,7 @@
<p align="center"> # Game Tracker
<img alt="Tallee Logo" src="/artefacts/app-logo.png" width="200"/>
<h2 align="center">Tallee</h2>
</p>
<p align="center">
An open-source app to track card- and board games, manage players & groups and get statistics about your played games.
</p>
<p align="center">
<a href="https://apps.apple.com/">
<img src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/en-US"
alt="Download on the App Store"
height="48"
/>
</a>
<a href="https://play.google.com/">
<img alt="Get it on Google Play"
title="Google Play"
src="https://raw.githubusercontent.com/pd4d10/git-touch/main/assets/google-play-badge.png"
height="48"
/>
</a>
</p>
![Version](https://img.shields.io/badge/App--Version-0.0.1_Alpha-orange)
![Flutter](https://img.shields.io/badge/Flutter-3.38.6-027DFD?logo=flutter)
![iOS26](https://img.shields.io/badge/iOS-26-white?logo=apple)
![Android16](https://img.shields.io/badge/Android-16-3DDC84?logo=android)
## Screenshots
<table align="center" cellspacing="8">
<tr>
<td><img src="/artefacts/screenshot-1.png" alt="Screenshot 1" width="240" /></td>
<td><img src="/artefacts/screenshot-2.png" alt="Screenshot 2" width="240" /></td>
<td><img src="/artefacts/screenshot-3.png" alt="Screenshot 3" width="240" /></td>
<td><img src="/artefacts/screenshot-4.png" alt="Screenshot 4" width="240" /></td>
</tr>
</table>
## Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. If you'd like to
contribute code, feel free to fork the repository and submit a pull request. For contribution guidelines, please refer
to [CONTRIBUTING.md](CONTRIBUTING.md).
## License
This project is licensed under the GNU LGPLv3 License. See the [LICENSE](LICENSE) file for details.
## Contributors
<a href="https://github.com/liquiddevelopmentde/game-tracker/graphs/contributors">
<img src="https://contrib.rocks/image?repo=liquiddevelopmentde/game-tracker" />
</a>
## Credits
Tallee is developed and maintained by [Liquid Development](https://liquid-dev.de). For more information or support regarding Tallee, contact us through our website or [hello@liquid-dev.de](mailto:hello@liquid-dev.de).
![Created by Liquid Development](https://img.shields.io/badge/Created_by-Liquid_Development-027DFD?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iRWJlbmVfMSIgZGF0YS1uYW1lPSJFYmVuZSAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3MjUuNDggODk3LjMiPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuY2xzLTEgewogICAgICAgIGZpbGw6ICNmZmY7CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgPC9kZWZzPgogIDxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTcwNS4yNiw3MDEuOTJsNi40LDExLjA4Yy0xLjk1LTMuODEtNC4wOS03LjUxLTYuNC0xMS4wOFoiLz4KICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik02MDIuMzksODk3LjI1aC03LjIxYzEuMi4wMywyLjQuMDUsMy42MS4wNXMyLjQxLS4wMiwzLjYxLS4wNVoiLz4KICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0wLDY5NS4zOGwyLjY4LTQuNjRjLS45MywxLjUyLTEuODIsMy4wNy0yLjY4LDQuNjRaIi8+CiAgPHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNjgyLjU1LDcyMy40NWw2LjA1LDEwLjQ5Yy0xLjc5LTMuNjQtMy44MS03LjE1LTYuMDUtMTAuNDlaIi8+CiAgPHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMzcuNzIsNzMzLjI4bDUuMy05LjE4Yy0xLjk0LDIuOTQtMy43MSw2LjAxLTUuMyw5LjE4WiIvPgogIDxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTcxMS42Niw3MTMuMDFsLTYuNC0xMS4wOC0yMjAuNDYtMzgxLjg0aDBWMTAxLjg0YzIwLjY3LTYuOTgsMzUuNTYtMjYuNTIsMzUuNTYtNDkuNTQsMC0yOC44OC0yMy40MS01Mi4zLTUyLjMtNTIuM2gtMjA5LjQ4Yy0yOC44OCwwLTUyLjMsMjMuNDEtNTIuMyw1Mi4zLDAsMjIuNzEsMTQuNDgsNDIuMDMsMzQuNyw0OS4yNXYyMTguNTRsLS4zMy41OEwxOC44OSw3MDQuNzlsLTIuNjgsNC42NGMtOS45OSwxOC4xMi0xNS42OCwzOC45Ni0xNS42OCw2MS4xMiwwLDY5Ljk3LDU2LjY0LDEyNi43LDEyNi41MSwxMjYuN2g0NzUuMzVjNjguMy0xLjkxLDEyMy4wOS01Ny44OCwxMjMuMDktMTI2LjY0LDAtMjAuNzQtNC45OS00MC4zMi0xMy44Mi01Ny42Wk02MDguNTYsODYyLjUzSDExNy40M2MtNDkuMzcsMC04OS4zOS00MC4wMi04OS4zOS04OS4zOSwwLTE0LjM2LDMuMzktMjcuOTMsOS40MS0zOS45Nmw1LjMtOS4xOCwyMzMuMi00MDMuOTJoLS4wOFYxMDQuNTloMTcuODFjOS40NywwLDE3LjE1LTcuNjgsMTcuMTUtMTcuMTVzLTcuNjgtMTcuMTUtMTcuMTUtMTcuMTVoLTM1LjU5di0uMDJjLTkuNzItLjI2LTE3LjUyLTguMi0xNy41Mi0xNy45OHM3LjgtMTcuNzIsMTcuNTItMTcuOTh2LS4wMmgyMDkuMjZjOS45NCwwLDE4LDguMDYsMTgsMThzLTguMDYsMTgtMTgsMThoLTM0LjQ4Yy05LjQ3LDAtMTcuMTUsNy42OC0xNy4xNSwxNy4xNXM3LjY4LDE3LjE1LDE3LjE1LDE3LjE1aDE3LjA0djIxNS40OWguMDdsMjMyLjgyLDQwMy4yNiw2LjA2LDEwLjVjNS44MiwxMS44Niw5LjA5LDI1LjIsOS4wOSwzOS4zLDAsNDkuMzctNDAuMDIsODkuMzktODkuMzksODkuMzlaIi8+CiAgPHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMzgxLjY4LDU0NS4zOGMtMy4wOCwxLjY4LTYuMTgsMy4zLTkuMzIsNC44NiwzLjA3LTEuNjcsNi4xOC0zLjI5LDkuMzItNC44NloiLz4KICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik01ODMuNDIsNTUxLjE5bC0yMC42Ny0zNS44Yy0xMy42OS0xLjg0LTI3LjY3LTIuNzktNDEuODYtMi43OS0xNy45OSwwLTM1LjYyLDEuNTMtNTIuNzgsNC40Ni0zMC41Niw1LjIxLTU5LjYsMTQuODktODYuNDIsMjguMzMtMy4wOCwxLjY4LTYuMTgsMy4zLTkuMzIsNC44Ni00MS44OCwyMC45OS04OS4xNiwzMi43OS0xMzkuMTksMzIuNzktMzQuODUsMC02OC4zNS01Ljc0LTk5LjYzLTE2LjMxLDAsMCwwLC4wMiwwLC4wMmwtMTYuNTIsMjguNjFjMzcuMDEsMTUuNTMsNzcuNjUsMjQuMTIsMTIwLjMsMjQuMTIsMTcuOTgsMCwzNS42MS0xLjUzLDUyLjc2LTQuNDYsMzIuNzctNS41OSw2My43OC0xNi4zMSw5Mi4yLTMxLjI5Ljg3LS40NiwxLjczLS45MiwyLjYtMS40LDQzLjI5LTIyLjgyLDkyLjYyLTM1Ljc0LDE0NC45Ni0zNS43NCwxOC4yOCwwLDM2LjE4LDEuNTksNTMuNTksNC42MWwtLjAyLS4wMloiLz4KICA8Zz4KICAgIDxjaXJjbGUgY2xhc3M9ImNscy0xIiBjeD0iNTg3LjY0IiBjeT0iODAzLjQiIHI9IjE4Ljk2Ii8+CiAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik01MTUuNTIsNzg0LjQzSDEwMy41NWMtMTAuOTIsMC0xOS43Niw4LjQ5LTE5Ljc2LDE4Ljk2czguODUsMTguOTYsMTkuNzYsMTguOTZoNDExLjk3YzEwLjkyLDAsMTkuNzYtOC40OSwxOS43Ni0xOC45NnMtOC44NS0xOC45Ni0xOS43Ni0xOC45NloiLz4KICA8L2c+CiAgPGNpcmNsZSBjbGFzcz0iY2xzLTEiIGN4PSIyODMuMzIiIGN5PSI0NjcuNTkiIHI9IjE4Ljk2Ii8+CiAgPGNpcmNsZSBjbGFzcz0iY2xzLTEiIGN4PSIzMjYuMjMiIGN5PSIzNjYuMjUiIHI9IjE4Ljk2Ii8+CiAgPHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDA2LjU2LDM4NS4yMmMtMjQuMDYsMC00My41NiwxOS41LTQzLjU2LDQzLjU2czE5LjUsNDMuNTYsNDMuNTYsNDMuNTYsNDMuNTYtMTkuNSw0My41Ni00My41Ni0xOS41LTQzLjU2LTQzLjU2LTQzLjU2Wk00MDYuNTYsNDQ3Ljc0Yy0xMC40NywwLTE4Ljk2LTguNDktMTguOTYtMTguOTZzOC40OS0xOC45NiwxOC45Ni0xOC45NiwxOC45Niw4LjQ5LDE4Ljk2LDE4Ljk2LTguNDksMTguOTYtMTguOTYsMTguOTZaIi8+Cjwvc3ZnPg==)
![Version](https://img.shields.io/badge/Version-0.3.0-orange)
![Flutter](https://img.shields.io/badge/Flutter-3.32.1-blue?logo=flutter)
![Dart](https://img.shields.io/badge/Dart-3.8.1-blue?logo=dart)
A all-in-one app to track card- and board games, manage players and groups and get statistics about your played games.

View File

@@ -10,5 +10,4 @@ linter:
prefer_const_declarations: true prefer_const_declarations: true
prefer_const_literals_to_create_immutables: true prefer_const_literals_to_create_immutables: true
unnecessary_const: true unnecessary_const: true
lines_longer_than_80_chars: false lines_longer_than_80_chars: false
constant_identifier_names: false

View File

@@ -6,7 +6,7 @@ plugins {
} }
android { android {
namespace = "de.liquid.tallee" namespace = "com.example.game_tracker"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion ndkVersion = flutter.ndkVersion
@@ -21,7 +21,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "de.liquid.tallee" applicationId = "com.example.game_tracker"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion minSdk = flutter.minSdkVersion

View File

@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application <application
android:label="Tallee" android:label="game_tracker"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
@@ -43,14 +42,5 @@
<action android:name="android.intent.action.PROCESS_TEXT"/> <action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/> <data android:mimeType="text/plain"/>
</intent> </intent>
<!-- Required for url_launcher to open URLs in external browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries> </queries>
</manifest> </manifest>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -1,4 +1,4 @@
package de.liquid.tallee package com.example.game_tracker
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="launch_background">#ef681f</color> <color name="app_icon_background">#E6F1E4</color>
<color name="launch_background">#0B0B0B</color>
</resources> </resources>

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="ic_launcher_background">#EF681F</color> <!-- Referenz unbedingt als @color/launch_background (nicht @colors/...) -->
<color name="ic_launcher_background">@color/app_icon_background</color>
</resources> </resources>

View File

@@ -18,7 +18,7 @@ pluginManagement {
plugins { plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0" id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.9.1" apply false id("com.android.application") version "8.7.3" apply false
id("org.jetbrains.kotlin.android") version "2.1.0" apply false id("org.jetbrains.kotlin.android") version "2.1.0" apply false
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

View File

@@ -152,6 +152,7 @@
B68CF4A64F0B5E45B43D6900 /* Pods-RunnerTests.release.xcconfig */, B68CF4A64F0B5E45B43D6900 /* Pods-RunnerTests.release.xcconfig */,
E754D1191B3E54E52B6DCC49 /* Pods-RunnerTests.profile.xcconfig */, E754D1191B3E54E52B6DCC49 /* Pods-RunnerTests.profile.xcconfig */,
); );
name = Pods;
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@@ -477,7 +478,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = de.liquid.tallee; PRODUCT_BUNDLE_IDENTIFIER = com.example.gameTracker;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -660,7 +661,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = de.liquid.tallee; PRODUCT_BUNDLE_IDENTIFIER = com.example.gameTracker;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -683,7 +684,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = de.liquid.tallee; PRODUCT_BUNDLE_IDENTIFIER = com.example.gameTracker;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1 +1,14 @@
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]} {
"images" : [
{
"filename" : "icon_x1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@@ -5,9 +5,9 @@
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0.122", "blue" : "0.043",
"green" : "0.408", "green" : "0.043",
"red" : "0.937" "red" : "0.043"
} }
}, },
"idiom" : "universal" "idiom" : "universal"

View File

@@ -1,8 +1,17 @@
{ {
"images" : [ "images" : [
{ {
"filename" : "icon-transparent.png", "filename" : "icon.png",
"idiom" : "universal" "idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
} }
], ],
"info" : { "info" : {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24412" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/> <device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24504"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24405"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
@@ -20,19 +20,12 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Tallee" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m4u-iU-Cmv">
<rect key="frame" x="153" y="747" width="87" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Futura-Bold" family="Futura" pointSize="28"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="LauncherIcon" translatesAutoresizingMaskIntoConstraints="NO" id="ygV-Op-Bu5"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="LauncherIcon" translatesAutoresizingMaskIntoConstraints="NO" id="ygV-Op-Bu5">
<rect key="frame" x="46" y="334" width="301" height="184"/> <rect key="frame" x="46" y="334" width="301" height="184"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
</subviews> </subviews>
<color key="backgroundColor" name="LauncherColor"/> <color key="backgroundColor" name="LauncherBackgroundColor"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -43,8 +36,8 @@
<color key="tintColor" red="0.90196078431372551" green="0.94509803921568625" blue="0.89411764705882346" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.90196078431372551" green="0.94509803921568625" blue="0.89411764705882346" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<resources> <resources>
<image name="LauncherIcon" width="1000" height="1000"/> <image name="LauncherIcon" width="1000" height="1000"/>
<namedColor name="LauncherColor"> <namedColor name="LauncherBackgroundColor">
<color red="0.93699997663497925" green="0.40799999237060547" blue="0.12200000137090683" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.90196078431372551" green="0.94509803921568625" blue="0.89411764705882346" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
</resources> </resources>
</document> </document>

View File

@@ -2,12 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Tallee</string> <string>Game Tracker</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@@ -15,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>tallee</string> <string>game_tracker</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
@@ -24,15 +22,8 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
<string>http</string>
</array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
@@ -48,5 +39,9 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>

View File

@@ -2,5 +2,4 @@ arb-dir: lib/l10n/arb
template-arb-file: app_en.arb template-arb-file: app_en.arb
output-localization-file: app_localizations.dart output-localization-file: app_localizations.dart
output-dir: lib/l10n/generated output-dir: lib/l10n/generated
nullable-getter: false nullable-getter: false
untranslated-messages-file: lib/l10n/untranslated_messages.json

View File

@@ -1,11 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Returns a platform-adaptive page route based on the current platform.
/// - On iOS, it returns a [CupertinoPageRoute].
/// - On other platforms, it returns a [MaterialPageRoute].
Route<T> adaptivePageRoute<T>({ Route<T> adaptivePageRoute<T>({
required Widget Function(BuildContext) builder, required Widget Function(BuildContext) builder,
bool fullscreenDialog = false, bool fullscreenDialog = false,

View File

@@ -1,22 +1,6 @@
/// Application-wide constants
class Constants { class Constants {
Constants._(); // Private constructor to prevent instantiation Constants._(); // Private constructor to prevent instantiation
/// Minimum duration of all app skeletons /// Minimum duration of all app skeletons
static const Duration MINIMUM_SKELETON_DURATION = Duration(milliseconds: 250); static Duration minimumSkeletonDuration = const Duration(milliseconds: 250);
/// Maximum length for player names
static const int MAX_PLAYER_NAME_LENGTH = 32;
/// Maximum length for group names
static const int MAX_GROUP_NAME_LENGTH = 32;
/// Maximum length for match names
static const int MAX_MATCH_NAME_LENGTH = 32;
/// Maximum length for game names
static const int MAX_GAME_NAME_LENGTH = 32;
/// Maximum length for team names
static const int MAX_TEAM_NAME_LENGTH = 32;
} }

View File

@@ -1,40 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Theme class that defines colors, border radius, padding, and decorations
class CustomTheme { class CustomTheme {
CustomTheme._(); // Private constructor to prevent instantiation CustomTheme._(); // Private constructor to prevent instantiation
// ==================== Colors ==================== // ==================== Colors ====================
static Color primaryColor = const Color(0xFF7505E4);
/// Primary color of the app theme static Color secondaryColor = const Color(0xFFAFA2FF);
static const Color primaryColor = Color(0xFFef681f); static Color backgroundColor = const Color(0xFF0B0B0B);
static Color boxColor = const Color(0xFF101010);
/// Secondary color of the app theme static Color onBoxColor = const Color(0xFF181818);
static const Color secondaryColor = Color(0xFFf2a981); static Color boxBorder = const Color(0xFF272727);
static const Color textColor = Colors.white;
/// Background color of the app theme
static const Color backgroundColor = Color(0xFF0B0B0B);
/// Default color for boxes and containers
static const Color boxColor = Color(0xFF101010);
/// Default border color for boxes and containers
static const Color boxBorderColor = Color(0xFF272727);
/// Color for boxes and containers displayed on boxes
static const Color onBoxColor = Color(0xFF181818);
/// Text color used throughout the app
static const Color textColor = Color(0xFFFFFFFF);
/// Background color for the navigation bar
static const Color navBarBackgroundColor = Color(0xFF131313);
/// Selected color for the [NavbarItem]
static Color navBarItemSelectedColor = primaryColor.withGreen(100);
/// Unselected color for the [NavbarItem]
static Color navBarItemUnselectedColor = Colors.grey.shade400;
// ==================== Border Radius ==================== // ==================== Border Radius ====================
static const double standardBorderRadius = 12.0; static const double standardBorderRadius = 12.0;
@@ -54,7 +30,7 @@ class CustomTheme {
// ==================== Decorations ==================== // ==================== Decorations ====================
static BoxDecoration standardBoxDecoration = BoxDecoration( static BoxDecoration standardBoxDecoration = BoxDecoration(
color: boxColor, color: boxColor,
border: Border.all(color: boxBorderColor), border: Border.all(color: boxBorder),
borderRadius: standardBorderRadiusAll, borderRadius: standardBorderRadiusAll,
); );
@@ -66,18 +42,18 @@ class CustomTheme {
); );
// ==================== App Bar Theme ==================== // ==================== App Bar Theme ====================
static const AppBarTheme appBarTheme = AppBarTheme( static AppBarTheme appBarTheme = AppBarTheme(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
foregroundColor: textColor, foregroundColor: textColor,
elevation: 0, elevation: 0,
scrolledUnderElevation: 0, scrolledUnderElevation: 0,
centerTitle: true, centerTitle: true,
titleTextStyle: TextStyle( titleTextStyle: const TextStyle(
color: textColor, color: textColor,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
iconTheme: IconThemeData(color: textColor), iconTheme: const IconThemeData(color: textColor),
); );
} }

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:tallee/l10n/generated/app_localizations.dart'; import 'package:game_tracker/l10n/generated/app_localizations.dart';
/// Button types used for styling the [CustomWidthButton] /// Button types used for styling the [CustomWidthButton]
/// - [ButtonType.primary]: Primary button style. /// - [ButtonType.primary]: Primary button style.

179
lib/data/dao/game_dao.dart Normal file
View File

@@ -0,0 +1,179 @@
import 'package:drift/drift.dart';
import 'package:game_tracker/data/db/database.dart';
import 'package:game_tracker/data/db/tables/game_table.dart';
import 'package:game_tracker/data/dto/game.dart';
part 'game_dao.g.dart';
@DriftAccessor(tables: [GameTable])
class GameDao extends DatabaseAccessor<AppDatabase> with _$GameDaoMixin {
GameDao(super.db);
/// Retrieves all games from the database.
Future<List<Game>> getAllGames() async {
final query = select(gameTable);
final result = await query.get();
return result
.map(
(row) => Game(
id: row.id,
name: row.name,
ruleset: row.ruleset,
description: row.description,
color: row.color != null ? int.tryParse(row.color!) : null,
icon: row.icon,
createdAt: row.createdAt,
),
)
.toList();
}
/// Retrieves a [Game] by its [gameId].
Future<Game> getGameById({required String gameId}) async {
final query = select(gameTable)..where((g) => g.id.equals(gameId));
final result = await query.getSingle();
return Game(
id: result.id,
name: result.name,
ruleset: result.ruleset,
description: result.description,
color: result.color != null ? int.tryParse(result.color!) : null,
icon: result.icon,
createdAt: result.createdAt,
);
}
/// Adds a new [game] to the database.
/// If a game with the same ID already exists, no action is taken.
/// Returns `true` if the game was added, `false` otherwise.
Future<bool> addGame({required Game game}) async {
if (!await gameExists(gameId: game.id)) {
await into(gameTable).insert(
GameTableCompanion.insert(
id: game.id,
name: game.name,
ruleset: game.ruleset ?? '',
description: Value(game.description),
color: Value(game.color?.toString()),
icon: Value(game.icon),
createdAt: game.createdAt,
),
mode: InsertMode.insertOrReplace,
);
return true;
}
return false;
}
/// Adds multiple [games] to the database in a batch operation.
/// Uses insertOrIgnore to avoid overwriting existing games.
Future<bool> addGamesAsList({required List<Game> games}) async {
if (games.isEmpty) return false;
await db.batch(
(b) => b.insertAll(
gameTable,
games
.map(
(game) => GameTableCompanion.insert(
id: game.id,
name: game.name,
ruleset: game.ruleset ?? '',
description: Value(game.description),
color: Value(game.color?.toString()),
icon: Value(game.icon),
createdAt: game.createdAt,
),
)
.toList(),
mode: InsertMode.insertOrIgnore,
),
);
return true;
}
/// Deletes the game with the given [gameId] from the database.
/// Returns `true` if the game was deleted, `false` if the game did not exist.
Future<bool> deleteGame({required String gameId}) async {
final query = delete(gameTable)..where((g) => g.id.equals(gameId));
final rowsAffected = await query.go();
return rowsAffected > 0;
}
/// Checks if a game with the given [gameId] exists in the database.
/// Returns `true` if the game exists, `false` otherwise.
Future<bool> gameExists({required String gameId}) async {
final query = select(gameTable)..where((g) => g.id.equals(gameId));
final result = await query.getSingleOrNull();
return result != null;
}
/// Updates the name of the game with the given [gameId] to [newName].
Future<void> updateGameName({
required String gameId,
required String newName,
}) async {
await (update(gameTable)..where((g) => g.id.equals(gameId))).write(
GameTableCompanion(name: Value(newName)),
);
}
/// Updates the ruleset of the game with the given [gameId].
Future<void> updateGameRuleset({
required String gameId,
required String newRuleset,
}) async {
await (update(gameTable)..where((g) => g.id.equals(gameId))).write(
GameTableCompanion(ruleset: Value(newRuleset)),
);
}
/// Updates the description of the game with the given [gameId].
Future<void> updateGameDescription({
required String gameId,
required String? newDescription,
}) async {
await (update(gameTable)..where((g) => g.id.equals(gameId))).write(
GameTableCompanion(description: Value(newDescription)),
);
}
/// Updates the color of the game with the given [gameId].
Future<void> updateGameColor({
required String gameId,
required int? newColor,
}) async {
await (update(gameTable)..where((g) => g.id.equals(gameId))).write(
GameTableCompanion(color: Value(newColor?.toString())),
);
}
/// Updates the icon of the game with the given [gameId].
Future<void> updateGameIcon({
required String gameId,
required String? newIcon,
}) async {
await (update(gameTable)..where((g) => g.id.equals(gameId))).write(
GameTableCompanion(icon: Value(newIcon)),
);
}
/// Retrieves the total count of games in the database.
Future<int> getGameCount() async {
final count =
await (selectOnly(gameTable)..addColumns([gameTable.id.count()]))
.map((row) => row.read(gameTable.id.count()))
.getSingle();
return count ?? 0;
}
/// Deletes all games from the database.
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> deleteAllGames() async {
final query = delete(gameTable);
final rowsAffected = await query.go();
return rowsAffected > 0;
}
}

View File

@@ -1,9 +1,9 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/database.dart'; import 'package:game_tracker/data/db/database.dart';
import 'package:tallee/data/db/tables/group_table.dart'; import 'package:game_tracker/data/db/tables/group_table.dart';
import 'package:tallee/data/db/tables/player_group_table.dart'; import 'package:game_tracker/data/db/tables/player_group_table.dart';
import 'package:tallee/data/dto/group.dart'; import 'package:game_tracker/data/dto/group.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/dto/player.dart';
part 'group_dao.g.dart'; part 'group_dao.g.dart';
@@ -23,6 +23,7 @@ class GroupDao extends DatabaseAccessor<AppDatabase> with _$GroupDaoMixin {
return Group( return Group(
id: groupData.id, id: groupData.id,
name: groupData.name, name: groupData.name,
description: groupData.description,
members: members, members: members,
createdAt: groupData.createdAt, createdAt: groupData.createdAt,
); );
@@ -42,6 +43,7 @@ class GroupDao extends DatabaseAccessor<AppDatabase> with _$GroupDaoMixin {
return Group( return Group(
id: result.id, id: result.id,
name: result.name, name: result.name,
description: result.description,
members: members, members: members,
createdAt: result.createdAt, createdAt: result.createdAt,
); );
@@ -56,6 +58,7 @@ class GroupDao extends DatabaseAccessor<AppDatabase> with _$GroupDaoMixin {
GroupTableCompanion.insert( GroupTableCompanion.insert(
id: group.id, id: group.id,
name: group.name, name: group.name,
description: Value(group.description),
createdAt: group.createdAt, createdAt: group.createdAt,
), ),
mode: InsertMode.insertOrReplace, mode: InsertMode.insertOrReplace,
@@ -105,6 +108,7 @@ class GroupDao extends DatabaseAccessor<AppDatabase> with _$GroupDaoMixin {
(group) => GroupTableCompanion.insert( (group) => GroupTableCompanion.insert(
id: group.id, id: group.id,
name: group.name, name: group.name,
description: Value(group.description),
createdAt: group.createdAt, createdAt: group.createdAt,
), ),
) )
@@ -132,6 +136,7 @@ class GroupDao extends DatabaseAccessor<AppDatabase> with _$GroupDaoMixin {
(p) => PlayerTableCompanion.insert( (p) => PlayerTableCompanion.insert(
id: p.id, id: p.id,
name: p.name, name: p.name,
description: Value(p.description),
createdAt: p.createdAt, createdAt: p.createdAt,
), ),
) )

View File

@@ -1,54 +1,50 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/database.dart'; import 'package:game_tracker/data/db/database.dart';
import 'package:tallee/data/db/tables/group_match_table.dart'; import 'package:game_tracker/data/db/tables/group_match_table.dart';
import 'package:tallee/data/dto/group.dart'; import 'package:game_tracker/data/db/tables/group_table.dart';
import 'package:game_tracker/data/dto/group.dart';
part 'group_match_dao.g.dart'; part 'group_match_dao.g.dart';
@DriftAccessor(tables: [GroupMatchTable]) @DriftAccessor(tables: [GroupMatchTable, GroupTable])
class GroupMatchDao extends DatabaseAccessor<AppDatabase> class GroupMatchDao extends DatabaseAccessor<AppDatabase>
with _$GroupMatchDaoMixin { with _$GroupMatchDaoMixin {
GroupMatchDao(super.db); GroupMatchDao(super.db);
/// Associates a group with a match by inserting a record into the /// Adds a group to a match by inserting a record into the [GroupMatchTable].
/// [GroupMatchTable].
Future<void> addGroupToMatch({ Future<void> addGroupToMatch({
required String matchId, required String matchId,
required String groupId, required String groupId,
}) async { }) async {
if (await matchHasGroup(matchId: matchId)) {
throw Exception('Match already has a group');
}
await into(groupMatchTable).insert( await into(groupMatchTable).insert(
GroupMatchTableCompanion.insert(groupId: groupId, matchId: matchId), GroupMatchTableCompanion.insert(
matchId: matchId,
groupId: groupId,
),
mode: InsertMode.insertOrIgnore, mode: InsertMode.insertOrIgnore,
); );
} }
/// Retrieves the [Group] associated with the given [matchId]. /// Retrieves the [Group] associated with the given [matchId].
/// Returns `null` if no group is found. /// Returns null if no group is found.
Future<Group?> getGroupOfMatch({required String matchId}) async { Future<Group?> getGroupOfMatch({required String matchId}) async {
final result = await (select( final query = select(groupMatchTable)
groupMatchTable, ..where((gm) => gm.matchId.equals(matchId));
)..where((g) => g.matchId.equals(matchId))).getSingleOrNull(); final result = await query.getSingleOrNull();
if (result == null) { if (result == null) return null;
return null;
}
final group = await db.groupDao.getGroupById(groupId: result.groupId); return db.groupDao.getGroupById(groupId: result.groupId);
return group;
} }
/// Checks if there is a group associated with the given [matchId]. /// Checks if a match has a group associated with it.
/// Returns `true` if there is a group, otherwise `false`. /// Returns `true` if the match has a group, otherwise `false`.
Future<bool> matchHasGroup({required String matchId}) async { Future<bool> matchHasGroup({required String matchId}) async {
final count = final count = await (selectOnly(groupMatchTable)
await (selectOnly(groupMatchTable) ..where(groupMatchTable.matchId.equals(matchId))
..where(groupMatchTable.matchId.equals(matchId)) ..addColumns([groupMatchTable.groupId.count()]))
..addColumns([groupMatchTable.groupId.count()])) .map((row) => row.read(groupMatchTable.groupId.count()))
.map((row) => row.read(groupMatchTable.groupId.count())) .getSingle();
.getSingle();
return (count ?? 0) > 0; return (count ?? 0) > 0;
} }
@@ -58,41 +54,55 @@ class GroupMatchDao extends DatabaseAccessor<AppDatabase>
required String matchId, required String matchId,
required String groupId, required String groupId,
}) async { }) async {
final count = final query = select(groupMatchTable)
await (selectOnly(groupMatchTable) ..where(
..where( (gm) => gm.matchId.equals(matchId) & gm.groupId.equals(groupId),
groupMatchTable.matchId.equals(matchId) & );
groupMatchTable.groupId.equals(groupId), final result = await query.getSingleOrNull();
) return result != null;
..addColumns([groupMatchTable.groupId.count()]))
.map((row) => row.read(groupMatchTable.groupId.count()))
.getSingle();
return (count ?? 0) > 0;
} }
/// Removes the association of a group from a match based on [groupId] and /// Removes the association of a group with a match by deleting the record
/// [matchId]. /// from the [GroupMatchTable].
/// Returns `true` if more than 0 rows were affected, otherwise `false`. /// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> removeGroupFromMatch({ Future<bool> removeGroupFromMatch({
required String matchId, required String matchId,
required String groupId, required String groupId,
}) async { }) async {
final query = delete(groupMatchTable) final query = delete(groupMatchTable)
..where((g) => g.matchId.equals(matchId) & g.groupId.equals(groupId)); ..where((gm) => gm.matchId.equals(matchId) & gm.groupId.equals(groupId));
final rowsAffected = await query.go(); final rowsAffected = await query.go();
return rowsAffected > 0; return rowsAffected > 0;
} }
/// Updates the group associated with a match to [newGroupId] based on /// Updates the group associated with a match.
/// [matchId]. /// Removes the existing group association and adds the new one.
/// Returns `true` if more than 0 rows were affected, otherwise `false`. Future<void> updateGroupOfMatch({
Future<bool> updateGroupOfMatch({
required String matchId, required String matchId,
required String newGroupId, required String newGroupId,
}) async { }) async {
final updatedRows = await db.transaction(() async {
await (update(groupMatchTable)..where((g) => g.matchId.equals(matchId))) // Remove existing group association
.write(GroupMatchTableCompanion(groupId: Value(newGroupId))); await (delete(groupMatchTable)
return updatedRows > 0; ..where((gm) => gm.matchId.equals(matchId)))
.go();
// Add new group association
await into(groupMatchTable).insert(
GroupMatchTableCompanion.insert(
matchId: matchId,
groupId: newGroupId,
),
);
});
}
/// Retrieves all matches associated with a specific group.
Future<List<String>> getMatchIdsForGroup({required String groupId}) async {
final query = select(groupMatchTable)
..where((gm) => gm.groupId.equals(groupId));
final result = await query.get();
return result.map((row) => row.matchId).toList();
} }
} }

View File

@@ -1,10 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'group_match_dao.dart';
// ignore_for_file: type=lint
mixin _$GroupMatchDaoMixin on DatabaseAccessor<AppDatabase> {
$GroupTableTable get groupTable => attachedDatabase.groupTable;
$MatchTableTable get matchTable => attachedDatabase.matchTable;
$GroupMatchTableTable get groupMatchTable => attachedDatabase.groupMatchTable;
}

View File

@@ -1,13 +1,17 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/database.dart'; import 'package:game_tracker/data/db/database.dart';
import 'package:tallee/data/db/tables/match_table.dart'; import 'package:game_tracker/data/db/tables/game_table.dart';
import 'package:tallee/data/dto/group.dart'; import 'package:game_tracker/data/db/tables/group_table.dart';
import 'package:tallee/data/dto/match.dart'; import 'package:game_tracker/data/db/tables/match_table.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/db/tables/player_match_table.dart';
import 'package:game_tracker/data/dto/game.dart';
import 'package:game_tracker/data/dto/group.dart';
import 'package:game_tracker/data/dto/match.dart';
import 'package:game_tracker/data/dto/player.dart';
part 'match_dao.g.dart'; part 'match_dao.g.dart';
@DriftAccessor(tables: [MatchTable]) @DriftAccessor(tables: [MatchTable, GameTable, GroupTable, PlayerMatchTable])
class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin { class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
MatchDao(super.db); MatchDao(super.db);
@@ -18,20 +22,22 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
return Future.wait( return Future.wait(
result.map((row) async { result.map((row) async {
final group = await db.groupMatchDao.getGroupOfMatch(matchId: row.id); final game = await db.gameDao.getGameById(gameId: row.gameId);
Group? group;
if (row.groupId != null) {
group = await db.groupDao.getGroupById(groupId: row.groupId!);
}
final players = await db.playerMatchDao.getPlayersOfMatch( final players = await db.playerMatchDao.getPlayersOfMatch(
matchId: row.id, matchId: row.id,
); );
final winner = row.winnerId != null
? await db.playerDao.getPlayerById(playerId: row.winnerId!)
: null;
return Match( return Match(
id: row.id, id: row.id,
name: row.name, name: row.name ?? '',
game: game,
group: group, group: group,
players: players, players: players,
notes: row.notes,
createdAt: row.createdAt, createdAt: row.createdAt,
winner: winner,
); );
}), }),
); );
@@ -42,100 +48,110 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
final query = select(matchTable)..where((g) => g.id.equals(matchId)); final query = select(matchTable)..where((g) => g.id.equals(matchId));
final result = await query.getSingle(); final result = await query.getSingle();
final game = await db.gameDao.getGameById(gameId: result.gameId);
Group? group;
if (result.groupId != null) {
group = await db.groupDao.getGroupById(groupId: result.groupId!);
}
List<Player>? players; List<Player>? players;
if (await db.playerMatchDao.matchHasPlayers(matchId: matchId)) { if (await db.playerMatchDao.matchHasPlayers(matchId: matchId)) {
players = await db.playerMatchDao.getPlayersOfMatch(matchId: matchId); players = await db.playerMatchDao.getPlayersOfMatch(matchId: matchId);
} }
Group? group;
if (await db.groupMatchDao.matchHasGroup(matchId: matchId)) {
group = await db.groupMatchDao.getGroupOfMatch(matchId: matchId);
}
Player? winner;
if (result.winnerId != null) {
winner = await db.playerDao.getPlayerById(playerId: result.winnerId!);
}
return Match( return Match(
id: result.id, id: result.id,
name: result.name, name: result.name ?? '',
players: players, game: game,
group: group, group: group,
winner: winner, players: players,
notes: result.notes,
createdAt: result.createdAt, createdAt: result.createdAt,
); );
} }
/// Adds a new [Match] to the database. Also adds players and group /// Adds a new [Match] to the database. Also adds players associations.
/// associations. This method assumes that the players and groups added to /// This method assumes that the game and group (if any) are already present
/// this match are already present in the database. /// in the database.
Future<void> addMatch({required Match match}) async { Future<void> addMatch({required Match match}) async {
if (match.game == null) {
throw ArgumentError('Match must have a game associated with it');
}
await db.transaction(() async { await db.transaction(() async {
await into(matchTable).insert( await into(matchTable).insert(
MatchTableCompanion.insert( MatchTableCompanion.insert(
id: match.id, id: match.id,
name: match.name, gameId: match.game!.id,
winnerId: Value(match.winner?.id), groupId: Value(match.group?.id),
name: Value(match.name),
notes: Value(match.notes),
createdAt: match.createdAt, createdAt: match.createdAt,
), ),
mode: InsertMode.insertOrReplace, mode: InsertMode.insertOrReplace,
); );
if (match.players != null) { if (match.players != null) {
for (final p in match.players ?? []) { for (final p in match.players!) {
await db.playerMatchDao.addPlayerToMatch( await db.playerMatchDao.addPlayerToMatch(
matchId: match.id, matchId: match.id,
playerId: p.id, playerId: p.id,
); );
} }
} }
if (match.group != null) {
await db.groupMatchDao.addGroupToMatch(
matchId: match.id,
groupId: match.group!.id,
);
}
}); });
} }
/// Adds multiple [Match]s to the database in a batch operation. /// Adds multiple [Match]es to the database in a batch operation.
/// Also adds associated players and groups if they exist. /// Also adds associated players and groups if they exist.
/// If the [matches] list is empty, the method returns immediately. /// If the [matches] list is empty, the method returns immediately.
/// This Method should only be used to import matches from a different device. /// This method should only be used to import matches from a different device.
Future<void> addMatchAsList({required List<Match> matches}) async { Future<void> addMatchAsList({required List<Match> matches}) async {
if (matches.isEmpty) return; if (matches.isEmpty) return;
await db.transaction(() async { await db.transaction(() async {
// Add all matches in batch // Add all games first (deduplicated)
await db.batch( final uniqueGames = <String, Game>{};
(b) => b.insertAll( for (final match in matches) {
matchTable, if (match.game != null) {
matches uniqueGames[match.game!.id] = match.game!;
.map( }
(match) => MatchTableCompanion.insert( }
id: match.id,
name: match.name, if (uniqueGames.isNotEmpty) {
createdAt: match.createdAt, await db.batch(
winnerId: Value(match.winner?.id), (b) => b.insertAll(
), db.gameTable,
) uniqueGames.values
.toList(), .map(
mode: InsertMode.insertOrReplace, (game) => GameTableCompanion.insert(
), id: game.id,
); name: game.name,
ruleset: game.ruleset ?? '',
description: Value(game.description),
color: Value(game.color?.toString()),
icon: Value(game.icon),
createdAt: game.createdAt,
),
)
.toList(),
mode: InsertMode.insertOrIgnore,
),
);
}
// Add all groups of the matches in batch // Add all groups of the matches in batch
// Using insertOrIgnore to avoid overwriting existing groups (which would
// trigger cascade deletes on player_group associations)
await db.batch( await db.batch(
(b) => b.insertAll( (b) => b.insertAll(
db.groupTable, db.groupTable,
matches matches
.where((match) => match.group != null) .where((match) => match.group != null)
.map( .map(
(matches) => GroupTableCompanion.insert( (match) => GroupTableCompanion.insert(
id: matches.group!.id, id: match.group!.id,
name: matches.group!.name, name: match.group!.name,
createdAt: matches.group!.createdAt, description: Value(match.group!.description),
createdAt: match.group!.createdAt,
), ),
) )
.toList(), .toList(),
@@ -143,6 +159,27 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
), ),
); );
// Add all matches in batch
await db.batch(
(b) => b.insertAll(
matchTable,
matches
.where((match) => match.game != null)
.map(
(match) => MatchTableCompanion.insert(
id: match.id,
gameId: match.game!.id,
groupId: Value(match.group?.id),
name: Value(match.name),
notes: Value(match.notes),
createdAt: match.createdAt,
),
)
.toList(),
mode: InsertMode.insertOrReplace,
),
);
// Add all players of the matches in batch (unique) // Add all players of the matches in batch (unique)
final uniquePlayers = <String, Player>{}; final uniquePlayers = <String, Player>{};
for (final match in matches) { for (final match in matches) {
@@ -160,8 +197,6 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
} }
if (uniquePlayers.isNotEmpty) { if (uniquePlayers.isNotEmpty) {
// Using insertOrIgnore to avoid triggering cascade deletes on
// player_group/player_match associations when players already exist
await db.batch( await db.batch(
(b) => b.insertAll( (b) => b.insertAll(
db.playerTable, db.playerTable,
@@ -170,6 +205,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
(p) => PlayerTableCompanion.insert( (p) => PlayerTableCompanion.insert(
id: p.id, id: p.id,
name: p.name, name: p.name,
description: Value(p.description),
createdAt: p.createdAt, createdAt: p.createdAt,
), ),
) )
@@ -183,12 +219,13 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
await db.batch((b) { await db.batch((b) {
for (final match in matches) { for (final match in matches) {
if (match.players != null) { if (match.players != null) {
for (final p in match.players ?? []) { for (final p in match.players!) {
b.insert( b.insert(
db.playerMatchTable, db.playerMatchTable,
PlayerMatchTableCompanion.insert( PlayerMatchTableCompanion.insert(
matchId: match.id, matchId: match.id,
playerId: p.id, playerId: p.id,
score: 0,
), ),
mode: InsertMode.insertOrIgnore, mode: InsertMode.insertOrIgnore,
); );
@@ -214,22 +251,6 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
} }
} }
}); });
// Add all group-match associations in batch
await db.batch((b) {
for (final match in matches) {
if (match.group != null) {
b.insert(
db.groupMatchTable,
GroupMatchTableCompanion.insert(
matchId: match.id,
groupId: match.group!.id,
),
mode: InsertMode.insertOrIgnore,
);
}
}
});
}); });
} }
@@ -266,52 +287,20 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
return rowsAffected > 0; return rowsAffected > 0;
} }
/// Sets the winner of the match with the given [matchId] to the player with /// Updates the notes of the match with the given [matchId].
/// the given [winnerId].
/// Returns `true` if more than 0 rows were affected, otherwise `false`. /// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> setWinner({ Future<bool> updateMatchNotes({
required String matchId, required String matchId,
required String winnerId, required String? notes,
}) async { }) async {
final query = update(matchTable)..where((g) => g.id.equals(matchId)); final query = update(matchTable)..where((g) => g.id.equals(matchId));
final rowsAffected = await query.write( final rowsAffected = await query.write(
MatchTableCompanion(winnerId: Value(winnerId)), MatchTableCompanion(notes: Value(notes)),
); );
return rowsAffected > 0; return rowsAffected > 0;
} }
/// Retrieves the winner of the match with the given [matchId]. /// Changes the name of the match with the given [matchId] to [newName].
/// Returns the [Player] who won the match, or `null` if no winner is set.
Future<Player?> getWinner({required String matchId}) async {
final query = select(matchTable)..where((g) => g.id.equals(matchId));
final result = await query.getSingleOrNull();
if (result == null || result.winnerId == null) {
return null;
}
final winner = await db.playerDao.getPlayerById(playerId: result.winnerId!);
return winner;
}
/// Removes the winner of the match with the given [matchId].
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> removeWinner({required String matchId}) async {
final query = update(matchTable)..where((g) => g.id.equals(matchId));
final rowsAffected = await query.write(
const MatchTableCompanion(winnerId: Value(null)),
);
return rowsAffected > 0;
}
/// Checks if the match with the given [matchId] has a winner set.
/// Returns `true` if a winner is set, otherwise `false`.
Future<bool> hasWinner({required String matchId}) async {
final query = select(matchTable)
..where((g) => g.id.equals(matchId) & g.winnerId.isNotNull());
final result = await query.getSingleOrNull();
return result != null;
}
/// Changes the title of the match with the given [matchId] to [newName].
/// Returns `true` if more than 0 rows were affected, otherwise `false`. /// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> updateMatchName({ Future<bool> updateMatchName({
required String matchId, required String matchId,
@@ -323,4 +312,31 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
); );
return rowsAffected > 0; return rowsAffected > 0;
} }
/// Updates the game of the match with the given [matchId].
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> updateMatchGame({
required String matchId,
required String gameId,
}) async {
final query = update(matchTable)..where((g) => g.id.equals(matchId));
final rowsAffected = await query.write(
MatchTableCompanion(gameId: Value(gameId)),
);
return rowsAffected > 0;
}
/// Updates the group of the match with the given [matchId].
/// Pass null to remove the group association.
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> updateMatchGroup({
required String matchId,
required String? groupId,
}) async {
final query = update(matchTable)..where((g) => g.id.equals(matchId));
final rowsAffected = await query.write(
MatchTableCompanion(groupId: Value(groupId)),
);
return rowsAffected > 0;
}
} }

View File

@@ -1,7 +1,7 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/database.dart'; import 'package:game_tracker/data/db/database.dart';
import 'package:tallee/data/db/tables/player_table.dart'; import 'package:game_tracker/data/db/tables/player_table.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/dto/player.dart';
part 'player_dao.g.dart'; part 'player_dao.g.dart';

View File

@@ -1,8 +1,8 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/database.dart'; import 'package:game_tracker/data/db/database.dart';
import 'package:tallee/data/db/tables/player_group_table.dart'; import 'package:game_tracker/data/db/tables/player_group_table.dart';
import 'package:tallee/data/db/tables/player_table.dart'; import 'package:game_tracker/data/db/tables/player_table.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/dto/player.dart';
part 'player_group_dao.g.dart'; part 'player_group_dao.g.dart';

View File

@@ -1,7 +1,7 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/database.dart'; import 'package:game_tracker/data/db/database.dart';
import 'package:tallee/data/db/tables/player_match_table.dart'; import 'package:game_tracker/data/db/tables/player_match_table.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/dto/player.dart';
part 'player_match_dao.g.dart'; part 'player_match_dao.g.dart';

View File

@@ -1,18 +1,16 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:drift_flutter/drift_flutter.dart'; import 'package:drift_flutter/drift_flutter.dart';
import 'package:game_tracker/data/dao/group_dao.dart';
import 'package:game_tracker/data/dao/match_dao.dart';
import 'package:game_tracker/data/dao/player_dao.dart';
import 'package:game_tracker/data/dao/player_group_dao.dart';
import 'package:game_tracker/data/dao/player_match_dao.dart';
import 'package:game_tracker/data/db/tables/group_table.dart';
import 'package:game_tracker/data/db/tables/match_table.dart';
import 'package:game_tracker/data/db/tables/player_group_table.dart';
import 'package:game_tracker/data/db/tables/player_match_table.dart';
import 'package:game_tracker/data/db/tables/player_table.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:tallee/data/dao/group_dao.dart';
import 'package:tallee/data/dao/group_match_dao.dart';
import 'package:tallee/data/dao/match_dao.dart';
import 'package:tallee/data/dao/player_dao.dart';
import 'package:tallee/data/dao/player_group_dao.dart';
import 'package:tallee/data/dao/player_match_dao.dart';
import 'package:tallee/data/db/tables/group_match_table.dart';
import 'package:tallee/data/db/tables/group_table.dart';
import 'package:tallee/data/db/tables/match_table.dart';
import 'package:tallee/data/db/tables/player_group_table.dart';
import 'package:tallee/data/db/tables/player_match_table.dart';
import 'package:tallee/data/db/tables/player_table.dart';
part 'database.g.dart'; part 'database.g.dart';
@@ -22,16 +20,14 @@ part 'database.g.dart';
GroupTable, GroupTable,
MatchTable, MatchTable,
PlayerGroupTable, PlayerGroupTable,
PlayerMatchTable, PlayerMatchTable
GroupMatchTable,
], ],
daos: [ daos: [
PlayerDao, PlayerDao,
GroupDao, GroupDao,
MatchDao, MatchDao,
PlayerGroupDao, PlayerGroupDao,
PlayerMatchDao, PlayerMatchDao
GroupMatchDao,
], ],
) )
class AppDatabase extends _$AppDatabase { class AppDatabase extends _$AppDatabase {

View File

@@ -527,17 +527,6 @@ class $MatchTableTable extends MatchTable
final GeneratedDatabase attachedDatabase; final GeneratedDatabase attachedDatabase;
final String? _alias; final String? _alias;
$MatchTableTable(this.attachedDatabase, [this._alias]); $MatchTableTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _winnerIdMeta = const VerificationMeta(
'winnerId',
);
@override
late final GeneratedColumn<String> winnerId = GeneratedColumn<String>(
'winner_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _idMeta = const VerificationMeta('id'); static const VerificationMeta _idMeta = const VerificationMeta('id');
@override @override
late final GeneratedColumn<String> id = GeneratedColumn<String>( late final GeneratedColumn<String> id = GeneratedColumn<String>(
@@ -556,6 +545,17 @@ class $MatchTableTable extends MatchTable
type: DriftSqlType.string, type: DriftSqlType.string,
requiredDuringInsert: true, requiredDuringInsert: true,
); );
static const VerificationMeta _winnerIdMeta = const VerificationMeta(
'winnerId',
);
@override
late final GeneratedColumn<String> winnerId = GeneratedColumn<String>(
'winner_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta( static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt', 'createdAt',
); );
@@ -568,7 +568,7 @@ class $MatchTableTable extends MatchTable
requiredDuringInsert: true, requiredDuringInsert: true,
); );
@override @override
List<GeneratedColumn> get $columns => [winnerId, id, name, createdAt]; List<GeneratedColumn> get $columns => [id, name, winnerId, createdAt];
@override @override
String get aliasedName => _alias ?? actualTableName; String get aliasedName => _alias ?? actualTableName;
@override @override
@@ -581,12 +581,6 @@ class $MatchTableTable extends MatchTable
}) { }) {
final context = VerificationContext(); final context = VerificationContext();
final data = instance.toColumns(true); final data = instance.toColumns(true);
if (data.containsKey('winner_id')) {
context.handle(
_winnerIdMeta,
winnerId.isAcceptableOrUnknown(data['winner_id']!, _winnerIdMeta),
);
}
if (data.containsKey('id')) { if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) { } else if (isInserting) {
@@ -600,6 +594,12 @@ class $MatchTableTable extends MatchTable
} else if (isInserting) { } else if (isInserting) {
context.missing(_nameMeta); context.missing(_nameMeta);
} }
if (data.containsKey('winner_id')) {
context.handle(
_winnerIdMeta,
winnerId.isAcceptableOrUnknown(data['winner_id']!, _winnerIdMeta),
);
}
if (data.containsKey('created_at')) { if (data.containsKey('created_at')) {
context.handle( context.handle(
_createdAtMeta, _createdAtMeta,
@@ -617,10 +617,6 @@ class $MatchTableTable extends MatchTable
MatchTableData map(Map<String, dynamic> data, {String? tablePrefix}) { MatchTableData map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return MatchTableData( return MatchTableData(
winnerId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}winner_id'],
),
id: attachedDatabase.typeMapping.read( id: attachedDatabase.typeMapping.read(
DriftSqlType.string, DriftSqlType.string,
data['${effectivePrefix}id'], data['${effectivePrefix}id'],
@@ -629,6 +625,10 @@ class $MatchTableTable extends MatchTable
DriftSqlType.string, DriftSqlType.string,
data['${effectivePrefix}name'], data['${effectivePrefix}name'],
)!, )!,
winnerId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}winner_id'],
),
createdAt: attachedDatabase.typeMapping.read( createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime, DriftSqlType.dateTime,
data['${effectivePrefix}created_at'], data['${effectivePrefix}created_at'],
@@ -643,35 +643,35 @@ class $MatchTableTable extends MatchTable
} }
class MatchTableData extends DataClass implements Insertable<MatchTableData> { class MatchTableData extends DataClass implements Insertable<MatchTableData> {
final String? winnerId;
final String id; final String id;
final String name; final String name;
final String? winnerId;
final DateTime createdAt; final DateTime createdAt;
const MatchTableData({ const MatchTableData({
this.winnerId,
required this.id, required this.id,
required this.name, required this.name,
this.winnerId,
required this.createdAt, required this.createdAt,
}); });
@override @override
Map<String, Expression> toColumns(bool nullToAbsent) { Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{}; final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['name'] = Variable<String>(name);
if (!nullToAbsent || winnerId != null) { if (!nullToAbsent || winnerId != null) {
map['winner_id'] = Variable<String>(winnerId); map['winner_id'] = Variable<String>(winnerId);
} }
map['id'] = Variable<String>(id);
map['name'] = Variable<String>(name);
map['created_at'] = Variable<DateTime>(createdAt); map['created_at'] = Variable<DateTime>(createdAt);
return map; return map;
} }
MatchTableCompanion toCompanion(bool nullToAbsent) { MatchTableCompanion toCompanion(bool nullToAbsent) {
return MatchTableCompanion( return MatchTableCompanion(
id: Value(id),
name: Value(name),
winnerId: winnerId == null && nullToAbsent winnerId: winnerId == null && nullToAbsent
? const Value.absent() ? const Value.absent()
: Value(winnerId), : Value(winnerId),
id: Value(id),
name: Value(name),
createdAt: Value(createdAt), createdAt: Value(createdAt),
); );
} }
@@ -682,9 +682,9 @@ class MatchTableData extends DataClass implements Insertable<MatchTableData> {
}) { }) {
serializer ??= driftRuntimeOptions.defaultSerializer; serializer ??= driftRuntimeOptions.defaultSerializer;
return MatchTableData( return MatchTableData(
winnerId: serializer.fromJson<String?>(json['winnerId']),
id: serializer.fromJson<String>(json['id']), id: serializer.fromJson<String>(json['id']),
name: serializer.fromJson<String>(json['name']), name: serializer.fromJson<String>(json['name']),
winnerId: serializer.fromJson<String?>(json['winnerId']),
createdAt: serializer.fromJson<DateTime>(json['createdAt']), createdAt: serializer.fromJson<DateTime>(json['createdAt']),
); );
} }
@@ -692,29 +692,29 @@ class MatchTableData extends DataClass implements Insertable<MatchTableData> {
Map<String, dynamic> toJson({ValueSerializer? serializer}) { Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer; serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{ return <String, dynamic>{
'winnerId': serializer.toJson<String?>(winnerId),
'id': serializer.toJson<String>(id), 'id': serializer.toJson<String>(id),
'name': serializer.toJson<String>(name), 'name': serializer.toJson<String>(name),
'winnerId': serializer.toJson<String?>(winnerId),
'createdAt': serializer.toJson<DateTime>(createdAt), 'createdAt': serializer.toJson<DateTime>(createdAt),
}; };
} }
MatchTableData copyWith({ MatchTableData copyWith({
Value<String?> winnerId = const Value.absent(),
String? id, String? id,
String? name, String? name,
Value<String?> winnerId = const Value.absent(),
DateTime? createdAt, DateTime? createdAt,
}) => MatchTableData( }) => MatchTableData(
winnerId: winnerId.present ? winnerId.value : this.winnerId,
id: id ?? this.id, id: id ?? this.id,
name: name ?? this.name, name: name ?? this.name,
winnerId: winnerId.present ? winnerId.value : this.winnerId,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
); );
MatchTableData copyWithCompanion(MatchTableCompanion data) { MatchTableData copyWithCompanion(MatchTableCompanion data) {
return MatchTableData( return MatchTableData(
winnerId: data.winnerId.present ? data.winnerId.value : this.winnerId,
id: data.id.present ? data.id.value : this.id, id: data.id.present ? data.id.value : this.id,
name: data.name.present ? data.name.value : this.name, name: data.name.present ? data.name.value : this.name,
winnerId: data.winnerId.present ? data.winnerId.value : this.winnerId,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
); );
} }
@@ -722,75 +722,75 @@ class MatchTableData extends DataClass implements Insertable<MatchTableData> {
@override @override
String toString() { String toString() {
return (StringBuffer('MatchTableData(') return (StringBuffer('MatchTableData(')
..write('winnerId: $winnerId, ')
..write('id: $id, ') ..write('id: $id, ')
..write('name: $name, ') ..write('name: $name, ')
..write('winnerId: $winnerId, ')
..write('createdAt: $createdAt') ..write('createdAt: $createdAt')
..write(')')) ..write(')'))
.toString(); .toString();
} }
@override @override
int get hashCode => Object.hash(winnerId, id, name, createdAt); int get hashCode => Object.hash(id, name, winnerId, createdAt);
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
identical(this, other) || identical(this, other) ||
(other is MatchTableData && (other is MatchTableData &&
other.winnerId == this.winnerId &&
other.id == this.id && other.id == this.id &&
other.name == this.name && other.name == this.name &&
other.winnerId == this.winnerId &&
other.createdAt == this.createdAt); other.createdAt == this.createdAt);
} }
class MatchTableCompanion extends UpdateCompanion<MatchTableData> { class MatchTableCompanion extends UpdateCompanion<MatchTableData> {
final Value<String?> winnerId;
final Value<String> id; final Value<String> id;
final Value<String> name; final Value<String> name;
final Value<String?> winnerId;
final Value<DateTime> createdAt; final Value<DateTime> createdAt;
final Value<int> rowid; final Value<int> rowid;
const MatchTableCompanion({ const MatchTableCompanion({
this.winnerId = const Value.absent(),
this.id = const Value.absent(), this.id = const Value.absent(),
this.name = const Value.absent(), this.name = const Value.absent(),
this.winnerId = const Value.absent(),
this.createdAt = const Value.absent(), this.createdAt = const Value.absent(),
this.rowid = const Value.absent(), this.rowid = const Value.absent(),
}); });
MatchTableCompanion.insert({ MatchTableCompanion.insert({
this.winnerId = const Value.absent(),
required String id, required String id,
required String name, required String name,
this.winnerId = const Value.absent(),
required DateTime createdAt, required DateTime createdAt,
this.rowid = const Value.absent(), this.rowid = const Value.absent(),
}) : id = Value(id), }) : id = Value(id),
name = Value(name), name = Value(name),
createdAt = Value(createdAt); createdAt = Value(createdAt);
static Insertable<MatchTableData> custom({ static Insertable<MatchTableData> custom({
Expression<String>? winnerId,
Expression<String>? id, Expression<String>? id,
Expression<String>? name, Expression<String>? name,
Expression<String>? winnerId,
Expression<DateTime>? createdAt, Expression<DateTime>? createdAt,
Expression<int>? rowid, Expression<int>? rowid,
}) { }) {
return RawValuesInsertable({ return RawValuesInsertable({
if (winnerId != null) 'winner_id': winnerId,
if (id != null) 'id': id, if (id != null) 'id': id,
if (name != null) 'name': name, if (name != null) 'name': name,
if (winnerId != null) 'winner_id': winnerId,
if (createdAt != null) 'created_at': createdAt, if (createdAt != null) 'created_at': createdAt,
if (rowid != null) 'rowid': rowid, if (rowid != null) 'rowid': rowid,
}); });
} }
MatchTableCompanion copyWith({ MatchTableCompanion copyWith({
Value<String?>? winnerId,
Value<String>? id, Value<String>? id,
Value<String>? name, Value<String>? name,
Value<String?>? winnerId,
Value<DateTime>? createdAt, Value<DateTime>? createdAt,
Value<int>? rowid, Value<int>? rowid,
}) { }) {
return MatchTableCompanion( return MatchTableCompanion(
winnerId: winnerId ?? this.winnerId,
id: id ?? this.id, id: id ?? this.id,
name: name ?? this.name, name: name ?? this.name,
winnerId: winnerId ?? this.winnerId,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
rowid: rowid ?? this.rowid, rowid: rowid ?? this.rowid,
); );
@@ -799,15 +799,15 @@ class MatchTableCompanion extends UpdateCompanion<MatchTableData> {
@override @override
Map<String, Expression> toColumns(bool nullToAbsent) { Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{}; final map = <String, Expression>{};
if (winnerId.present) {
map['winner_id'] = Variable<String>(winnerId.value);
}
if (id.present) { if (id.present) {
map['id'] = Variable<String>(id.value); map['id'] = Variable<String>(id.value);
} }
if (name.present) { if (name.present) {
map['name'] = Variable<String>(name.value); map['name'] = Variable<String>(name.value);
} }
if (winnerId.present) {
map['winner_id'] = Variable<String>(winnerId.value);
}
if (createdAt.present) { if (createdAt.present) {
map['created_at'] = Variable<DateTime>(createdAt.value); map['created_at'] = Variable<DateTime>(createdAt.value);
} }
@@ -820,9 +820,9 @@ class MatchTableCompanion extends UpdateCompanion<MatchTableData> {
@override @override
String toString() { String toString() {
return (StringBuffer('MatchTableCompanion(') return (StringBuffer('MatchTableCompanion(')
..write('winnerId: $winnerId, ')
..write('id: $id, ') ..write('id: $id, ')
..write('name: $name, ') ..write('name: $name, ')
..write('winnerId: $winnerId, ')
..write('createdAt: $createdAt, ') ..write('createdAt: $createdAt, ')
..write('rowid: $rowid') ..write('rowid: $rowid')
..write(')')) ..write(')'))
@@ -2339,17 +2339,17 @@ typedef $$GroupTableTableProcessedTableManager =
>; >;
typedef $$MatchTableTableCreateCompanionBuilder = typedef $$MatchTableTableCreateCompanionBuilder =
MatchTableCompanion Function({ MatchTableCompanion Function({
Value<String?> winnerId,
required String id, required String id,
required String name, required String name,
Value<String?> winnerId,
required DateTime createdAt, required DateTime createdAt,
Value<int> rowid, Value<int> rowid,
}); });
typedef $$MatchTableTableUpdateCompanionBuilder = typedef $$MatchTableTableUpdateCompanionBuilder =
MatchTableCompanion Function({ MatchTableCompanion Function({
Value<String?> winnerId,
Value<String> id, Value<String> id,
Value<String> name, Value<String> name,
Value<String?> winnerId,
Value<DateTime> createdAt, Value<DateTime> createdAt,
Value<int> rowid, Value<int> rowid,
}); });
@@ -2414,11 +2414,6 @@ class $$MatchTableTableFilterComposer
super.$addJoinBuilderToRootComposer, super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer, super.$removeJoinBuilderFromRootComposer,
}); });
ColumnFilters<String> get winnerId => $composableBuilder(
column: $table.winnerId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get id => $composableBuilder( ColumnFilters<String> get id => $composableBuilder(
column: $table.id, column: $table.id,
builder: (column) => ColumnFilters(column), builder: (column) => ColumnFilters(column),
@@ -2429,6 +2424,11 @@ class $$MatchTableTableFilterComposer
builder: (column) => ColumnFilters(column), builder: (column) => ColumnFilters(column),
); );
ColumnFilters<String> get winnerId => $composableBuilder(
column: $table.winnerId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<DateTime> get createdAt => $composableBuilder( ColumnFilters<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt, column: $table.createdAt,
builder: (column) => ColumnFilters(column), builder: (column) => ColumnFilters(column),
@@ -2494,11 +2494,6 @@ class $$MatchTableTableOrderingComposer
super.$addJoinBuilderToRootComposer, super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer, super.$removeJoinBuilderFromRootComposer,
}); });
ColumnOrderings<String> get winnerId => $composableBuilder(
column: $table.winnerId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get id => $composableBuilder( ColumnOrderings<String> get id => $composableBuilder(
column: $table.id, column: $table.id,
builder: (column) => ColumnOrderings(column), builder: (column) => ColumnOrderings(column),
@@ -2509,6 +2504,11 @@ class $$MatchTableTableOrderingComposer
builder: (column) => ColumnOrderings(column), builder: (column) => ColumnOrderings(column),
); );
ColumnOrderings<String> get winnerId => $composableBuilder(
column: $table.winnerId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<DateTime> get createdAt => $composableBuilder( ColumnOrderings<DateTime> get createdAt => $composableBuilder(
column: $table.createdAt, column: $table.createdAt,
builder: (column) => ColumnOrderings(column), builder: (column) => ColumnOrderings(column),
@@ -2524,15 +2524,15 @@ class $$MatchTableTableAnnotationComposer
super.$addJoinBuilderToRootComposer, super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer, super.$removeJoinBuilderFromRootComposer,
}); });
GeneratedColumn<String> get winnerId =>
$composableBuilder(column: $table.winnerId, builder: (column) => column);
GeneratedColumn<String> get id => GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column); $composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<String> get name => GeneratedColumn<String> get name =>
$composableBuilder(column: $table.name, builder: (column) => column); $composableBuilder(column: $table.name, builder: (column) => column);
GeneratedColumn<String> get winnerId =>
$composableBuilder(column: $table.winnerId, builder: (column) => column);
GeneratedColumn<DateTime> get createdAt => GeneratedColumn<DateTime> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column); $composableBuilder(column: $table.createdAt, builder: (column) => column);
@@ -2618,29 +2618,29 @@ class $$MatchTableTableTableManager
$$MatchTableTableAnnotationComposer($db: db, $table: table), $$MatchTableTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback: updateCompanionCallback:
({ ({
Value<String?> winnerId = const Value.absent(),
Value<String> id = const Value.absent(), Value<String> id = const Value.absent(),
Value<String> name = const Value.absent(), Value<String> name = const Value.absent(),
Value<String?> winnerId = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(), Value<DateTime> createdAt = const Value.absent(),
Value<int> rowid = const Value.absent(), Value<int> rowid = const Value.absent(),
}) => MatchTableCompanion( }) => MatchTableCompanion(
winnerId: winnerId,
id: id, id: id,
name: name, name: name,
winnerId: winnerId,
createdAt: createdAt, createdAt: createdAt,
rowid: rowid, rowid: rowid,
), ),
createCompanionCallback: createCompanionCallback:
({ ({
Value<String?> winnerId = const Value.absent(),
required String id, required String id,
required String name, required String name,
Value<String?> winnerId = const Value.absent(),
required DateTime createdAt, required DateTime createdAt,
Value<int> rowid = const Value.absent(), Value<int> rowid = const Value.absent(),
}) => MatchTableCompanion.insert( }) => MatchTableCompanion.insert(
winnerId: winnerId,
id: id, id: id,
name: name, name: name,
winnerId: winnerId,
createdAt: createdAt, createdAt: createdAt,
rowid: rowid, rowid: rowid,
), ),

View File

@@ -0,0 +1,14 @@
import 'package:drift/drift.dart';
class GameTable extends Table {
TextColumn get id => text()();
TextColumn get name => text()();
TextColumn get ruleset => text()();
TextColumn get description => text().nullable()();
TextColumn get color => text().nullable()();
TextColumn get icon => text().nullable()();
DateTimeColumn get createdAt => dateTime()();
@override
Set<Column<Object>> get primaryKey => {id};
}

View File

@@ -1,13 +0,0 @@
import 'package:drift/drift.dart';
import 'package:tallee/data/db/tables/group_table.dart';
import 'package:tallee/data/db/tables/match_table.dart';
class GroupMatchTable extends Table {
TextColumn get groupId =>
text().references(GroupTable, #id, onDelete: KeyAction.cascade)();
TextColumn get matchId =>
text().references(MatchTable, #id, onDelete: KeyAction.cascade)();
@override
Set<Column<Object>> get primaryKey => {groupId, matchId};
}

View File

@@ -3,6 +3,7 @@ import 'package:drift/drift.dart';
class GroupTable extends Table { class GroupTable extends Table {
TextColumn get id => text()(); TextColumn get id => text()();
TextColumn get name => text()(); TextColumn get name => text()();
TextColumn get description => text().nullable()();
DateTimeColumn get createdAt => dateTime()(); DateTimeColumn get createdAt => dateTime()();
@override @override

View File

@@ -1,11 +1,17 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:game_tracker/data/db/tables/game_table.dart';
import 'package:game_tracker/data/db/tables/group_table.dart';
class MatchTable extends Table { class MatchTable extends Table {
TextColumn get id => text()(); TextColumn get id => text()();
TextColumn get name => text()(); TextColumn get gameId =>
late final winnerId = text().nullable()(); text().references(GameTable, #id, onDelete: KeyAction.cascade)();
TextColumn get groupId =>
text().references(GroupTable, #id, onDelete: KeyAction.cascade).nullable()(); // Nullable if not part of a group
TextColumn get name => text().nullable()();
TextColumn get notes => text().nullable()();
DateTimeColumn get createdAt => dateTime()(); DateTimeColumn get createdAt => dateTime()();
@override @override
Set<Column<Object>> get primaryKey => {id}; Set<Column<Object>> get primaryKey => {id};
} }

View File

@@ -1,6 +1,6 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/tables/group_table.dart'; import 'package:game_tracker/data/db/tables/group_table.dart';
import 'package:tallee/data/db/tables/player_table.dart'; import 'package:game_tracker/data/db/tables/player_table.dart';
class PlayerGroupTable extends Table { class PlayerGroupTable extends Table {
TextColumn get playerId => TextColumn get playerId =>

View File

@@ -1,12 +1,16 @@
import 'package:drift/drift.dart'; import 'package:drift/drift.dart';
import 'package:tallee/data/db/tables/match_table.dart'; import 'package:game_tracker/data/db/tables/match_table.dart';
import 'package:tallee/data/db/tables/player_table.dart'; import 'package:game_tracker/data/db/tables/player_table.dart';
import 'package:game_tracker/data/db/tables/team_table.dart';
class PlayerMatchTable extends Table { class PlayerMatchTable extends Table {
TextColumn get playerId => TextColumn get playerId =>
text().references(PlayerTable, #id, onDelete: KeyAction.cascade)(); text().references(PlayerTable, #id, onDelete: KeyAction.cascade)();
TextColumn get matchId => TextColumn get matchId =>
text().references(MatchTable, #id, onDelete: KeyAction.cascade)(); text().references(MatchTable, #id, onDelete: KeyAction.cascade)();
TextColumn get teamId =>
text().references(TeamTable, #id).nullable()();
IntColumn get score => integer()();
@override @override
Set<Column<Object>> get primaryKey => {playerId, matchId}; Set<Column<Object>> get primaryKey => {playerId, matchId};

View File

@@ -3,6 +3,7 @@ import 'package:drift/drift.dart';
class PlayerTable extends Table { class PlayerTable extends Table {
TextColumn get id => text()(); TextColumn get id => text()();
TextColumn get name => text()(); TextColumn get name => text()();
TextColumn get description => text().nullable()();
DateTimeColumn get createdAt => dateTime()(); DateTimeColumn get createdAt => dateTime()();
@override @override

View File

@@ -0,0 +1,16 @@
import 'package:drift/drift.dart';
import 'package:game_tracker/data/db/tables/match_table.dart';
import 'package:game_tracker/data/db/tables/player_table.dart';
class ScoreTable extends Table {
TextColumn get playerId =>
text().references(PlayerTable, #id, onDelete: KeyAction.cascade)();
TextColumn get matchId =>
text().references(MatchTable, #id, onDelete: KeyAction.cascade)();
IntColumn get roundNumber => integer()();
IntColumn get score => integer()();
IntColumn get change => integer()();
@override
Set<Column<Object>> get primaryKey => {playerId, matchId, roundNumber};
}

View File

@@ -0,0 +1,10 @@
import 'package:drift/drift.dart';
class TeamTable extends Table {
TextColumn get id => text()();
TextColumn get name => text()();
DateTimeColumn get createdAt => dateTime()();
@override
Set<Column<Object>> get primaryKey => {id};
}

50
lib/data/dto/game.dart Normal file
View File

@@ -0,0 +1,50 @@
import 'package:clock/clock.dart';
import 'package:uuid/uuid.dart';
class Game {
final String id;
final DateTime createdAt;
final String name;
final String? ruleset;
final String? description;
final int? color;
final String? icon;
Game({
String? id,
DateTime? createdAt,
required this.name,
this.ruleset,
this.description,
this.color,
this.icon,
}) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now();
@override
String toString() {
return 'Game{id: $id, name: $name, ruleset: $ruleset, description: $description, color: $color, icon: $icon}';
}
/// Creates a Game instance from a JSON object.
Game.fromJson(Map<String, dynamic> json)
: id = json['id'],
createdAt = DateTime.parse(json['createdAt']),
name = json['name'],
ruleset = json['ruleset'],
description = json['description'],
color = json['color'],
icon = json['icon'];
/// Converts the Game instance to a JSON object.
Map<String, dynamic> toJson() => {
'id': id,
'createdAt': createdAt.toIso8601String(),
'name': name,
'ruleset': ruleset,
'description': description,
'color': color,
'icon': icon,
};
}

View File

@@ -1,24 +1,26 @@
import 'package:clock/clock.dart'; import 'package:clock/clock.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/dto/player.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
class Group { class Group {
final String id; final String id;
final DateTime createdAt;
final String name; final String name;
final String? description;
final DateTime createdAt;
final List<Player> members; final List<Player> members;
Group({ Group({
String? id, String? id,
DateTime? createdAt, DateTime? createdAt,
required this.name, required this.name,
this.description,
required this.members, required this.members,
}) : id = id ?? const Uuid().v4(), }) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now(); createdAt = createdAt ?? clock.now();
@override @override
String toString() { String toString() {
return 'Group{id: $id, name: $name,members: $members}'; return 'Group{id: $id, name: $name, description: $description, members: $members}';
} }
/// Creates a Group instance from a JSON object. /// Creates a Group instance from a JSON object.
@@ -26,6 +28,7 @@ class Group {
: id = json['id'], : id = json['id'],
createdAt = DateTime.parse(json['createdAt']), createdAt = DateTime.parse(json['createdAt']),
name = json['name'], name = json['name'],
description = json['description'],
members = (json['members'] as List) members = (json['members'] as List)
.map((memberJson) => Player.fromJson(memberJson)) .map((memberJson) => Player.fromJson(memberJson))
.toList(); .toList();
@@ -35,6 +38,7 @@ class Group {
'id': id, 'id': id,
'createdAt': createdAt.toIso8601String(), 'createdAt': createdAt.toIso8601String(),
'name': name, 'name': name,
'description': description,
'members': members.map((member) => member.toJson()).toList(), 'members': members.map((member) => member.toJson()).toList(),
}; };
} }

View File

@@ -1,51 +1,56 @@
import 'package:clock/clock.dart'; import 'package:clock/clock.dart';
import 'package:tallee/data/dto/group.dart'; import 'package:game_tracker/data/dto/game.dart';
import 'package:tallee/data/dto/player.dart'; import 'package:game_tracker/data/dto/group.dart';
import 'package:game_tracker/data/dto/player.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
class Match { class Match {
final String id; final String id;
final DateTime createdAt; final DateTime createdAt;
final String name; final String name;
final List<Player>? players; final Game? game;
final Group? group; final Group? group;
Player? winner; final List<Player>? players;
final String? notes;
Match({ Match({
String? id, String? id,
DateTime? createdAt, DateTime? createdAt,
required this.name, required this.name,
this.players, this.game,
this.group, this.group,
this.winner, this.players,
this.notes,
}) : id = id ?? const Uuid().v4(), }) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now(); createdAt = createdAt ?? clock.now();
@override @override
String toString() { String toString() {
return 'Match{\n\tid: $id,\n\tname: $name,\n\tplayers: $players,\n\tgroup: $group,\n\twinner: $winner\n}'; return 'Match{id: $id, name: $name, game: $game, group: $group, players: $players, notes: $notes}';
} }
/// Creates a Match instance from a JSON object. /// Creates a Match instance from a JSON object.
Match.fromJson(Map<String, dynamic> json) Match.fromJson(Map<String, dynamic> json)
: id = json['id'], : id = json['id'],
name = json['name'],
createdAt = DateTime.parse(json['createdAt']), createdAt = DateTime.parse(json['createdAt']),
name = json['name'],
game = json['game'] != null ? Game.fromJson(json['game']) : null,
group = json['group'] != null ? Group.fromJson(json['group']) : null,
players = json['players'] != null players = json['players'] != null
? (json['players'] as List) ? (json['players'] as List)
.map((playerJson) => Player.fromJson(playerJson)) .map((playerJson) => Player.fromJson(playerJson))
.toList() .toList()
: null, : null,
group = json['group'] != null ? Group.fromJson(json['group']) : null, notes = json['notes'];
winner = json['winner'] != null ? Player.fromJson(json['winner']) : null;
/// Converts the Match instance to a JSON object. /// Converts the Match instance to a JSON object.
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'id': id, 'id': id,
'createdAt': createdAt.toIso8601String(), 'createdAt': createdAt.toIso8601String(),
'name': name, 'name': name,
'players': players?.map((player) => player.toJson()).toList(), 'game': game?.toJson(),
'group': group?.toJson(), 'group': group?.toJson(),
'winner': winner?.toJson(), 'players': players?.map((player) => player.toJson()).toList(),
'notes': notes,
}; };
} }

16
lib/data/dto/pair.dart Normal file
View File

@@ -0,0 +1,16 @@
import 'package:game_tracker/data/dto/team.dart';
class Pair extends Team {
Pair({
super.id,
super.createdAt,
required super.members,
});
@override
String toString() {
return 'Pair{id: $id, members: $members}';
}
}

View File

@@ -5,26 +5,33 @@ class Player {
final String id; final String id;
final DateTime createdAt; final DateTime createdAt;
final String name; final String name;
final String? description;
Player({String? id, DateTime? createdAt, required this.name}) Player({
: id = id ?? const Uuid().v4(), String? id,
createdAt = createdAt ?? clock.now(); DateTime? createdAt,
required this.name,
this.description,
}) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now();
@override @override
String toString() { String toString() {
return 'Player{id: $id,name: $name}'; return 'Player{id: $id, name: $name, description: $description}';
} }
/// Creates a Player instance from a JSON object. /// Creates a Player instance from a JSON object.
Player.fromJson(Map<String, dynamic> json) Player.fromJson(Map<String, dynamic> json)
: id = json['id'], : id = json['id'],
createdAt = DateTime.parse(json['createdAt']), createdAt = DateTime.parse(json['createdAt']),
name = json['name']; name = json['name'],
description = json['description'];
/// Converts the Player instance to a JSON object. /// Converts the Player instance to a JSON object.
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'id': id, 'id': id,
'createdAt': createdAt.toIso8601String(), 'createdAt': createdAt.toIso8601String(),
'name': name, 'name': name,
'description': description,
}; };
} }

37
lib/data/dto/team.dart Normal file
View File

@@ -0,0 +1,37 @@
import 'package:clock/clock.dart';
import 'package:game_tracker/data/dto/player.dart';
import 'package:uuid/uuid.dart';
class Team {
final String id;
final DateTime createdAt;
final List<Player> members;
Team({
String? id,
DateTime? createdAt,
required this.members,
}) : id = id ?? const Uuid().v4(),
createdAt = createdAt ?? clock.now();
@override
String toString() {
return 'Team{id: $id, members: $members}';
}
/// Creates a Team instance from a JSON object.
Team.fromJson(Map<String, dynamic> json)
: id = json['id'],
createdAt = DateTime.parse(json['createdAt']),
members = (json['members'] as List)
.map((memberJson) => Player.fromJson(memberJson))
.toList();
/// Converts the Team instance to a JSON object.
Map<String, dynamic> toJson() => {
'id': id,
'createdAt': createdAt.toIso8601String(),
'members': members.map((member) => member.toJson()).toList(),
};
}

View File

@@ -3,8 +3,6 @@
"all_players": "Alle Spieler:innen", "all_players": "Alle Spieler:innen",
"all_players_selected": "Alle Spieler:innen ausgewählt", "all_players_selected": "Alle Spieler:innen ausgewählt",
"amount_of_matches": "Anzahl der Spiele", "amount_of_matches": "Anzahl der Spiele",
"app_name": "Tallee",
"best_player": "Beste:r Spieler:in",
"cancel": "Abbrechen", "cancel": "Abbrechen",
"choose_game": "Spielvorlage wählen", "choose_game": "Spielvorlage wählen",
"choose_group": "Gruppe wählen", "choose_group": "Gruppe wählen",
@@ -14,23 +12,13 @@
"create_match": "Spiel erstellen", "create_match": "Spiel erstellen",
"create_new_group": "Neue Gruppe erstellen", "create_new_group": "Neue Gruppe erstellen",
"create_new_match": "Neues Spiel erstellen", "create_new_match": "Neues Spiel erstellen",
"created_on": "Erstellt am",
"data": "Daten",
"data_successfully_deleted": "Daten erfolgreich gelöscht", "data_successfully_deleted": "Daten erfolgreich gelöscht",
"data_successfully_exported": "Daten erfolgreich exportiert", "data_successfully_exported": "Daten erfolgreich exportiert",
"data_successfully_imported": "Daten erfolgreich importiert", "data_successfully_imported": "Daten erfolgreich importiert",
"days_ago": "vor {count} Tagen", "days_ago": "vor {count} Tagen",
"delete": "Löschen", "delete": "Löschen",
"delete_all_data": "Alle Daten löschen", "delete_all_data": "Alle Daten löschen",
"delete_group": "Diese Gruppe löschen",
"edit_group": "Gruppe bearbeiten",
"delete_group": "Gruppe löschen",
"delete_match": "Spiel löschen",
"edit_group": "Gruppe bearbeiten",
"enter_results": "Ergebnisse eintragen",
"error_creating_group": "Fehler beim Erstellen der Gruppe, bitte erneut versuchen", "error_creating_group": "Fehler beim Erstellen der Gruppe, bitte erneut versuchen",
"error_deleting_group": "Fehler beim Löschen der Gruppe, bitte erneut versuchen",
"error_editing_group": "Fehler beim Bearbeiten der Gruppe, bitte erneut versuchen",
"error_reading_file": "Fehler beim Lesen der Datei", "error_reading_file": "Fehler beim Lesen der Datei",
"export_canceled": "Export abgebrochen", "export_canceled": "Export abgebrochen",
"export_data": "Daten exportieren", "export_data": "Daten exportieren",
@@ -39,7 +27,6 @@
"game_name": "Spielvorlagenname", "game_name": "Spielvorlagenname",
"group": "Gruppe", "group": "Gruppe",
"group_name": "Gruppenname", "group_name": "Gruppenname",
"group_profile": "Gruppenprofil",
"groups": "Gruppen", "groups": "Gruppen",
"home": "Startseite", "home": "Startseite",
"import_canceled": "Import abgebrochen", "import_canceled": "Import abgebrochen",
@@ -47,45 +34,33 @@
"info": "Info", "info": "Info",
"invalid_schema": "Ungültiges Schema", "invalid_schema": "Ungültiges Schema",
"least_points": "Niedrigste Punkte", "least_points": "Niedrigste Punkte",
"legal": "Rechtliches",
"legal_notice": "Impressum",
"licenses": "Lizenzen",
"match_in_progress": "Spiel läuft...", "match_in_progress": "Spiel läuft...",
"match_name": "Spieltitel", "match_name": "Spieltitel",
"match_profile": "Spielprofil",
"matches": "Spiele", "matches": "Spiele",
"members": "Mitglieder", "menu": "Menü",
"most_points": "Höchste Punkte", "most_points": "Höchste Punkte",
"no_data_available": "Keine Daten verfügbar", "no_data_available": "Keine Daten verfügbar",
"no_groups_created_yet": "Noch keine Gruppen erstellt", "no_groups_created_yet": "Noch keine Gruppen erstellt",
"no_licenses_found": "Keine Lizenzen gefunden",
"no_license_text_available": "Kein Lizenztext verfügbar",
"no_matches_created_yet": "Noch keine Spiele erstellt", "no_matches_created_yet": "Noch keine Spiele erstellt",
"no_players_created_yet": "Noch keine Spieler:in erstellt", "no_players_created_yet": "Noch keine Spieler:in erstellt",
"no_players_found_with_that_name": "Keine Spieler:in mit diesem Namen gefunden", "no_players_found_with_that_name": "Keine Spieler:in mit diesem Namen gefunden",
"no_players_selected": "Keine Spieler:innen ausgewählt", "no_players_selected": "Keine Spieler:innen ausgewählt",
"no_recent_matches_available": "Keine letzten Spiele verfügbar", "no_recent_matches_available": "Keine letzten Spiele verfügbar",
"no_results_entered_yet": "Noch keine Ergebnisse eingetragen",
"no_second_match_available": "Kein zweites Spiel verfügbar", "no_second_match_available": "Kein zweites Spiel verfügbar",
"no_statistics_available": "Keine Statistiken verfügbar", "no_statistics_available": "Keine Statistiken verfügbar",
"none": "Kein", "none": "Kein",
"none_group": "Keine", "none_group": "Keine",
"not_available": "Nicht verfügbar", "not_available": "Nicht verfügbar",
"played_matches": "Gespielte Spiele",
"player_name": "Spieler:innenname", "player_name": "Spieler:innenname",
"players": "Spieler:innen", "players": "Spieler:innen",
"players_count": "{count} Spieler", "players_count": "{count} Spieler",
"privacy_policy": "Datenschutzerklärung",
"quick_create": "Schnellzugriff", "quick_create": "Schnellzugriff",
"recent_matches": "Letzte Spiele", "recent_matches": "Letzte Spiele",
"result": "Ergebnis",
"results": "Ergebnisse",
"ruleset": "Regelwerk", "ruleset": "Regelwerk",
"ruleset_least_points": "Umgekehrte Wertung: Der/die Spieler:in mit den wenigsten Punkten gewinnt.", "ruleset_least_points": "Umgekehrte Wertung: Der/die Spieler:in mit den wenigsten Punkten gewinnt.",
"ruleset_most_points": "Traditionelles Regelwerk: Der/die Spieler:in mit den meisten Punkten gewinnt.", "ruleset_most_points": "Traditionelles Regelwerk: Der/die Spieler:in mit den meisten Punkten gewinnt.",
"ruleset_single_loser": "Genau ein:e Verlierer:in wird bestimmt; der letzte Platz erhält die Strafe oder Konsequenz.", "ruleset_single_loser": "Genau ein:e Verlierer:in wird bestimmt; der letzte Platz erhält die Strafe oder Konsequenz.",
"ruleset_single_winner": "Genau ein:e Gewinner:in wird gewählt; Unentschieden werden durch einen vordefinierten Tie-Breaker aufgelöst.", "ruleset_single_winner": "Genau ein:e Gewinner:in wird gewählt; Unentschieden werden durch einen vordefinierten Tie-Breaker aufgelöst.",
"save_changes": "Änderungen speichern",
"search_for_groups": "Nach Gruppen suchen", "search_for_groups": "Nach Gruppen suchen",
"search_for_players": "Nach Spieler:innen suchen", "search_for_players": "Nach Spieler:innen suchen",
"select_winner": "Gewinner:in wählen:", "select_winner": "Gewinner:in wählen:",
@@ -97,7 +72,7 @@
"stats": "Statistiken", "stats": "Statistiken",
"successfully_added_player": "Spieler:in {playerName} erfolgreich hinzugefügt", "successfully_added_player": "Spieler:in {playerName} erfolgreich hinzugefügt",
"there_is_no_group_matching_your_search": "Es gibt keine Gruppe, die deiner Suche entspricht", "there_is_no_group_matching_your_search": "Es gibt keine Gruppe, die deiner Suche entspricht",
"this_cannot_be_undone": "Dies kann nicht rückgängig gemacht werden.", "this_cannot_be_undone": "Dies kann nicht rückgängig gemacht werden",
"today_at": "Heute um", "today_at": "Heute um",
"undo": "Rückgängig", "undo": "Rückgängig",
"unknown_exception": "Unbekannter Fehler (siehe Konsole)", "unknown_exception": "Unbekannter Fehler (siehe Konsole)",

View File

@@ -12,9 +12,6 @@
"@app_name": { "@app_name": {
"description": "The name of the App" "description": "The name of the App"
}, },
"@best_player": {
"description": "Label for best player statistic"
},
"@cancel": { "@cancel": {
"description": "Cancel button text" "description": "Cancel button text"
}, },
@@ -37,16 +34,10 @@
"description": "Button text to create a match" "description": "Button text to create a match"
}, },
"@create_new_group": { "@create_new_group": {
"description": "Appbar text to create a new group" "description": "Button text to create a new group"
}, },
"@create_new_match": { "@create_new_match": {
"description": "Appbar text to create a new match" "description": "Button text to create a new match"
},
"@created_on": {
"description": "Label for creation date"
},
"@data": {
"description": "Data label"
}, },
"@data_successfully_deleted": { "@data_successfully_deleted": {
"description": "Success message after deleting data" "description": "Success message after deleting data"
@@ -71,27 +62,9 @@
"@delete_all_data": { "@delete_all_data": {
"description": "Confirmation dialog for deleting all data" "description": "Confirmation dialog for deleting all data"
}, },
"@delete_group": {
"description": "Confirmation dialog for deleting a group"
},
"@delete_match": {
"description": "Button text to delete a match"
},
"@edit_group": {
"description": "Button & Appbar label for editing a group"
},
"@enter_results": {
"description": "Button text to enter match results"
},
"@error_creating_group": { "@error_creating_group": {
"description": "Error message when group creation fails" "description": "Error message when group creation fails"
}, },
"@error_deleting_group": {
"description": "Error message when group deletion fails"
},
"@error_editing_group": {
"description": "Error message when group editing fails"
},
"@error_reading_file": { "@error_reading_file": {
"description": "Error message when file cannot be read" "description": "Error message when file cannot be read"
}, },
@@ -116,9 +89,6 @@
"@group_name": { "@group_name": {
"description": "Placeholder for group name input" "description": "Placeholder for group name input"
}, },
"@group_profile": {
"description": "Title for group profile view"
},
"@groups": { "@groups": {
"description": "Label for groups" "description": "Label for groups"
}, },
@@ -140,29 +110,17 @@
"@least_points": { "@least_points": {
"description": "Title for least points ruleset" "description": "Title for least points ruleset"
}, },
"@legal": {
"description": "Legal section header"
},
"@legal_notice": {
"description": "Legal notice menu item"
},
"@licenses": {
"description": "Licenses menu item"
},
"@match_in_progress": { "@match_in_progress": {
"description": "Message when match is in progress" "description": "Message when match is in progress"
}, },
"@match_name": { "@match_name": {
"description": "Placeholder for match name input" "description": "Placeholder for match name input"
}, },
"@match_profile": {
"description": "Title for match profile view"
},
"@matches": { "@matches": {
"description": "Label for matches" "description": "Label for matches"
}, },
"@members": { "@menu": {
"description": "Label for group members" "description": "Menu label"
}, },
"@most_points": { "@most_points": {
"description": "Title for most points ruleset" "description": "Title for most points ruleset"
@@ -173,12 +131,6 @@
"@no_groups_created_yet": { "@no_groups_created_yet": {
"description": "Message when no groups exist" "description": "Message when no groups exist"
}, },
"@no_licenses_found": {
"description": "Message when no licenses are found"
},
"@no_license_text_available": {
"description": "Message when no license text is available"
},
"@no_matches_created_yet": { "@no_matches_created_yet": {
"description": "Message when no matches exist" "description": "Message when no matches exist"
}, },
@@ -194,9 +146,6 @@
"@no_recent_matches_available": { "@no_recent_matches_available": {
"description": "Message when no recent matches exist" "description": "Message when no recent matches exist"
}, },
"@no_results_entered_yet": {
"description": "Message when no results have been entered yet"
},
"@no_second_match_available": { "@no_second_match_available": {
"description": "Message when no second match exists" "description": "Message when no second match exists"
}, },
@@ -212,9 +161,6 @@
"@not_available": { "@not_available": {
"description": "Abbreviation for not available" "description": "Abbreviation for not available"
}, },
"@played_matches": {
"description": "Label for played matches statistic"
},
"@player_name": { "@player_name": {
"description": "Placeholder for player name input" "description": "Placeholder for player name input"
}, },
@@ -229,18 +175,12 @@
} }
} }
}, },
"@privacy_policy": {
"description": "Privacy policy menu item"
},
"@quick_create": { "@quick_create": {
"description": "Title for quick create section" "description": "Title for quick create section"
}, },
"@recent_matches": { "@recent_matches": {
"description": "Title for recent matches section" "description": "Title for recent matches section"
}, },
"@results": {
"description": "Label for match results"
},
"@ruleset": { "@ruleset": {
"description": "Ruleset label" "description": "Ruleset label"
}, },
@@ -256,9 +196,6 @@
"@ruleset_single_winner": { "@ruleset_single_winner": {
"description": "Description for single winner ruleset" "description": "Description for single winner ruleset"
}, },
"@save_changes": {
"description": "Save changes button text"
},
"@search_for_groups": { "@search_for_groups": {
"description": "Hint text for group search input field" "description": "Hint text for group search input field"
}, },
@@ -272,7 +209,7 @@
"description": "Shows the number of selected players" "description": "Shows the number of selected players"
}, },
"@settings": { "@settings": {
"description": "Label for the App Settings" "description": "Settings label"
}, },
"@single_loser": { "@single_loser": {
"description": "Title for single loser ruleset" "description": "Title for single loser ruleset"
@@ -325,8 +262,7 @@
"all_players": "All players", "all_players": "All players",
"all_players_selected": "All players selected", "all_players_selected": "All players selected",
"amount_of_matches": "Amount of Matches", "amount_of_matches": "Amount of Matches",
"app_name": "Tallee", "app_name": "Game Tracker",
"best_player": "Best Player",
"cancel": "Cancel", "cancel": "Cancel",
"choose_game": "Choose Game", "choose_game": "Choose Game",
"choose_group": "Choose Group", "choose_group": "Choose Group",
@@ -335,22 +271,14 @@
"create_group": "Create Group", "create_group": "Create Group",
"create_match": "Create match", "create_match": "Create match",
"create_new_group": "Create new group", "create_new_group": "Create new group",
"created_on": "Created on",
"create_new_match": "Create new match", "create_new_match": "Create new match",
"data": "Data",
"data_successfully_deleted": "Data successfully deleted", "data_successfully_deleted": "Data successfully deleted",
"data_successfully_exported": "Data successfully exported", "data_successfully_exported": "Data successfully exported",
"data_successfully_imported": "Data successfully imported", "data_successfully_imported": "Data successfully imported",
"days_ago": "{count} days ago", "days_ago": "{count} days ago",
"delete": "Delete", "delete": "Delete",
"delete_all_data": "Delete all data", "delete_all_data": "Delete all data",
"delete_group": "Delete Group",
"delete_match": "Delete Match",
"edit_group": "Edit Group",
"enter_results": "Enter Results",
"error_creating_group": "Error while creating group, please try again", "error_creating_group": "Error while creating group, please try again",
"error_deleting_group": "Error while deleting group, please try again",
"error_editing_group": "Error while editing group, please try again",
"error_reading_file": "Error reading file", "error_reading_file": "Error reading file",
"export_canceled": "Export canceled", "export_canceled": "Export canceled",
"export_data": "Export data", "export_data": "Export data",
@@ -359,7 +287,6 @@
"game_name": "Game Name", "game_name": "Game Name",
"group": "Group", "group": "Group",
"group_name": "Group name", "group_name": "Group name",
"group_profile": "Group Profile",
"groups": "Groups", "groups": "Groups",
"home": "Home", "home": "Home",
"import_canceled": "Import canceled", "import_canceled": "Import canceled",
@@ -367,44 +294,33 @@
"info": "Info", "info": "Info",
"invalid_schema": "Invalid Schema", "invalid_schema": "Invalid Schema",
"least_points": "Least Points", "least_points": "Least Points",
"legal": "Legal",
"legal_notice": "Legal Notice",
"licenses": "Licenses",
"match_in_progress": "Match in progress...", "match_in_progress": "Match in progress...",
"match_name": "Match name", "match_name": "Match name",
"match_profile": "Match Profile",
"matches": "Matches", "matches": "Matches",
"members": "Members", "menu": "Menu",
"most_points": "Most Points", "most_points": "Most Points",
"no_data_available": "No data available", "no_data_available": "No data available",
"no_groups_created_yet": "No groups created yet", "no_groups_created_yet": "No groups created yet",
"no_licenses_found": "No licenses found",
"no_license_text_available": "No license text available",
"no_matches_created_yet": "No matches created yet", "no_matches_created_yet": "No matches created yet",
"no_players_created_yet": "No players created yet", "no_players_created_yet": "No players created yet",
"no_players_found_with_that_name": "No players found with that name", "no_players_found_with_that_name": "No players found with that name",
"no_players_selected": "No players selected", "no_players_selected": "No players selected",
"no_recent_matches_available": "No recent matches available", "no_recent_matches_available": "No recent matches available",
"no_results_entered_yet": "No results entered yet",
"no_second_match_available": "No second match available", "no_second_match_available": "No second match available",
"no_statistics_available": "No statistics available", "no_statistics_available": "No statistics available",
"none": "None", "none": "None",
"none_group": "None", "none_group": "None",
"not_available": "Not available", "not_available": "Not available",
"played_matches": "Played Matches",
"player_name": "Player name", "player_name": "Player name",
"players": "Players", "players": "Players",
"players_count": "{count} Players", "players_count": "{count} Players",
"privacy_policy": "Privacy Policy",
"quick_create": "Quick Create", "quick_create": "Quick Create",
"recent_matches": "Recent Matches", "recent_matches": "Recent Matches",
"results": "Results",
"ruleset": "Ruleset", "ruleset": "Ruleset",
"ruleset_least_points": "Inverse scoring: the player with the fewest points wins.", "ruleset_least_points": "Inverse scoring: the player with the fewest points wins.",
"ruleset_most_points": "Traditional ruleset: the player with the most points wins.", "ruleset_most_points": "Traditional ruleset: the player with the most points wins.",
"ruleset_single_loser": "Exactly one loser is determined; last place receives the penalty or consequence.", "ruleset_single_loser": "Exactly one loser is determined; last place receives the penalty or consequence.",
"ruleset_single_winner": "Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.", "ruleset_single_winner": "Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.",
"save_changes": "Save Changes",
"search_for_groups": "Search for groups", "search_for_groups": "Search for groups",
"search_for_players": "Search for players", "search_for_players": "Search for players",
"select_winner": "Select Winner:", "select_winner": "Select Winner:",
@@ -416,7 +332,7 @@
"stats": "Stats", "stats": "Stats",
"successfully_added_player": "Successfully added player {playerName}", "successfully_added_player": "Successfully added player {playerName}",
"there_is_no_group_matching_your_search": "There is no group matching your search", "there_is_no_group_matching_your_search": "There is no group matching your search",
"this_cannot_be_undone": "This can't be undone.", "this_cannot_be_undone": "This can't be undone",
"today_at": "Today at", "today_at": "Today at",
"undo": "Undo", "undo": "Undo",
"unknown_exception": "Unknown Exception (see console)", "unknown_exception": "Unknown Exception (see console)",

View File

@@ -119,15 +119,9 @@ abstract class AppLocalizations {
/// The name of the App /// The name of the App
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Tallee'** /// **'Game Tracker'**
String get app_name; String get app_name;
/// Label for best player statistic
///
/// In en, this message translates to:
/// **'Best Player'**
String get best_player;
/// Cancel button text /// Cancel button text
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -170,30 +164,18 @@ abstract class AppLocalizations {
/// **'Create match'** /// **'Create match'**
String get create_match; String get create_match;
/// Appbar text to create a new group /// Button text to create a new group
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Create new group'** /// **'Create new group'**
String get create_new_group; String get create_new_group;
/// Label for creation date /// Button text to create a new match
///
/// In en, this message translates to:
/// **'Created on'**
String get created_on;
/// Appbar text to create a new match
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Create new match'** /// **'Create new match'**
String get create_new_match; String get create_new_match;
/// Data label
///
/// In en, this message translates to:
/// **'Data'**
String get data;
/// Success message after deleting data /// Success message after deleting data
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -230,48 +212,12 @@ abstract class AppLocalizations {
/// **'Delete all data'** /// **'Delete all data'**
String get delete_all_data; String get delete_all_data;
/// Confirmation dialog for deleting a group
///
/// In en, this message translates to:
/// **'Delete Group'**
String get delete_group;
/// Button text to delete a match
///
/// In en, this message translates to:
/// **'Delete Match'**
String get delete_match;
/// Button & Appbar label for editing a group
///
/// In en, this message translates to:
/// **'Edit Group'**
String get edit_group;
/// Button text to enter match results
///
/// In en, this message translates to:
/// **'Enter Results'**
String get enter_results;
/// Error message when group creation fails /// Error message when group creation fails
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Error while creating group, please try again'** /// **'Error while creating group, please try again'**
String get error_creating_group; String get error_creating_group;
/// Error message when group deletion fails
///
/// In en, this message translates to:
/// **'Error while deleting group, please try again'**
String get error_deleting_group;
/// Error message when group editing fails
///
/// In en, this message translates to:
/// **'Error while editing group, please try again'**
String get error_editing_group;
/// Error message when file cannot be read /// Error message when file cannot be read
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -320,12 +266,6 @@ abstract class AppLocalizations {
/// **'Group name'** /// **'Group name'**
String get group_name; String get group_name;
/// Title for group profile view
///
/// In en, this message translates to:
/// **'Group Profile'**
String get group_profile;
/// Label for groups /// Label for groups
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -368,24 +308,6 @@ abstract class AppLocalizations {
/// **'Least Points'** /// **'Least Points'**
String get least_points; String get least_points;
/// Legal section header
///
/// In en, this message translates to:
/// **'Legal'**
String get legal;
/// Legal notice menu item
///
/// In en, this message translates to:
/// **'Legal Notice'**
String get legal_notice;
/// Licenses menu item
///
/// In en, this message translates to:
/// **'Licenses'**
String get licenses;
/// Message when match is in progress /// Message when match is in progress
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -398,23 +320,17 @@ abstract class AppLocalizations {
/// **'Match name'** /// **'Match name'**
String get match_name; String get match_name;
/// Title for match profile view
///
/// In en, this message translates to:
/// **'Match Profile'**
String get match_profile;
/// Label for matches /// Label for matches
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Matches'** /// **'Matches'**
String get matches; String get matches;
/// Label for group members /// Menu label
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Members'** /// **'Menu'**
String get members; String get menu;
/// Title for most points ruleset /// Title for most points ruleset
/// ///
@@ -434,18 +350,6 @@ abstract class AppLocalizations {
/// **'No groups created yet'** /// **'No groups created yet'**
String get no_groups_created_yet; String get no_groups_created_yet;
/// Message when no licenses are found
///
/// In en, this message translates to:
/// **'No licenses found'**
String get no_licenses_found;
/// Message when no license text is available
///
/// In en, this message translates to:
/// **'No license text available'**
String get no_license_text_available;
/// Message when no matches exist /// Message when no matches exist
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -476,12 +380,6 @@ abstract class AppLocalizations {
/// **'No recent matches available'** /// **'No recent matches available'**
String get no_recent_matches_available; String get no_recent_matches_available;
/// Message when no results have been entered yet
///
/// In en, this message translates to:
/// **'No results entered yet'**
String get no_results_entered_yet;
/// Message when no second match exists /// Message when no second match exists
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -512,12 +410,6 @@ abstract class AppLocalizations {
/// **'Not available'** /// **'Not available'**
String get not_available; String get not_available;
/// Label for played matches statistic
///
/// In en, this message translates to:
/// **'Played Matches'**
String get played_matches;
/// Placeholder for player name input /// Placeholder for player name input
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -536,12 +428,6 @@ abstract class AppLocalizations {
/// **'{count} Players'** /// **'{count} Players'**
String players_count(int count); String players_count(int count);
/// Privacy policy menu item
///
/// In en, this message translates to:
/// **'Privacy Policy'**
String get privacy_policy;
/// Title for quick create section /// Title for quick create section
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -554,12 +440,6 @@ abstract class AppLocalizations {
/// **'Recent Matches'** /// **'Recent Matches'**
String get recent_matches; String get recent_matches;
/// Label for match results
///
/// In en, this message translates to:
/// **'Results'**
String get results;
/// Ruleset label /// Ruleset label
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -590,12 +470,6 @@ abstract class AppLocalizations {
/// **'Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.'** /// **'Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.'**
String get ruleset_single_winner; String get ruleset_single_winner;
/// Save changes button text
///
/// In en, this message translates to:
/// **'Save Changes'**
String get save_changes;
/// Hint text for group search input field /// Hint text for group search input field
/// ///
/// In en, this message translates to: /// In en, this message translates to:
@@ -620,7 +494,7 @@ abstract class AppLocalizations {
/// **'Selected players'** /// **'Selected players'**
String get selected_players; String get selected_players;
/// Label for the App Settings /// Settings label
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'Settings'** /// **'Settings'**
@@ -665,7 +539,7 @@ abstract class AppLocalizations {
/// Warning message for irreversible actions /// Warning message for irreversible actions
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'This can\'t be undone.'** /// **'This can\'t be undone'**
String get this_cannot_be_undone; String get this_cannot_be_undone;
/// Date format for today /// Date format for today

View File

@@ -18,10 +18,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get amount_of_matches => 'Anzahl der Spiele'; String get amount_of_matches => 'Anzahl der Spiele';
@override @override
String get app_name => 'Tallee'; String get app_name => 'Game Tracker';
@override
String get best_player => 'Beste:r Spieler:in';
@override @override
String get cancel => 'Abbrechen'; String get cancel => 'Abbrechen';
@@ -49,15 +46,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get create_new_group => 'Neue Gruppe erstellen'; String get create_new_group => 'Neue Gruppe erstellen';
@override
String get created_on => 'Erstellt am';
@override @override
String get create_new_match => 'Neues Spiel erstellen'; String get create_new_match => 'Neues Spiel erstellen';
@override
String get data => 'Daten';
@override @override
String get data_successfully_deleted => 'Daten erfolgreich gelöscht'; String get data_successfully_deleted => 'Daten erfolgreich gelöscht';
@@ -78,30 +69,10 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get delete_all_data => 'Alle Daten löschen'; String get delete_all_data => 'Alle Daten löschen';
@override
String get delete_group => 'Gruppe löschen';
@override
String get delete_match => 'Spiel löschen';
@override
String get edit_group => 'Gruppe bearbeiten';
@override
String get enter_results => 'Ergebnisse eintragen';
@override @override
String get error_creating_group => String get error_creating_group =>
'Fehler beim Erstellen der Gruppe, bitte erneut versuchen'; 'Fehler beim Erstellen der Gruppe, bitte erneut versuchen';
@override
String get error_deleting_group =>
'Fehler beim Löschen der Gruppe, bitte erneut versuchen';
@override
String get error_editing_group =>
'Fehler beim Bearbeiten der Gruppe, bitte erneut versuchen';
@override @override
String get error_reading_file => 'Fehler beim Lesen der Datei'; String get error_reading_file => 'Fehler beim Lesen der Datei';
@@ -126,9 +97,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get group_name => 'Gruppenname'; String get group_name => 'Gruppenname';
@override
String get group_profile => 'Gruppenprofil';
@override @override
String get groups => 'Gruppen'; String get groups => 'Gruppen';
@@ -150,29 +118,17 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get least_points => 'Niedrigste Punkte'; String get least_points => 'Niedrigste Punkte';
@override
String get legal => 'Rechtliches';
@override
String get legal_notice => 'Impressum';
@override
String get licenses => 'Lizenzen';
@override @override
String get match_in_progress => 'Spiel läuft...'; String get match_in_progress => 'Spiel läuft...';
@override @override
String get match_name => 'Spieltitel'; String get match_name => 'Spieltitel';
@override
String get match_profile => 'Spielprofil';
@override @override
String get matches => 'Spiele'; String get matches => 'Spiele';
@override @override
String get members => 'Mitglieder'; String get menu => 'Menü';
@override @override
String get most_points => 'Höchste Punkte'; String get most_points => 'Höchste Punkte';
@@ -183,12 +139,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get no_groups_created_yet => 'Noch keine Gruppen erstellt'; String get no_groups_created_yet => 'Noch keine Gruppen erstellt';
@override
String get no_licenses_found => 'Keine Lizenzen gefunden';
@override
String get no_license_text_available => 'Kein Lizenztext verfügbar';
@override @override
String get no_matches_created_yet => 'Noch keine Spiele erstellt'; String get no_matches_created_yet => 'Noch keine Spiele erstellt';
@@ -205,9 +155,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get no_recent_matches_available => 'Keine letzten Spiele verfügbar'; String get no_recent_matches_available => 'Keine letzten Spiele verfügbar';
@override
String get no_results_entered_yet => 'Noch keine Ergebnisse eingetragen';
@override @override
String get no_second_match_available => 'Kein zweites Spiel verfügbar'; String get no_second_match_available => 'Kein zweites Spiel verfügbar';
@@ -223,9 +170,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get not_available => 'Nicht verfügbar'; String get not_available => 'Nicht verfügbar';
@override
String get played_matches => 'Gespielte Spiele';
@override @override
String get player_name => 'Spieler:innenname'; String get player_name => 'Spieler:innenname';
@@ -237,18 +181,12 @@ class AppLocalizationsDe extends AppLocalizations {
return '$count Spieler'; return '$count Spieler';
} }
@override
String get privacy_policy => 'Datenschutzerklärung';
@override @override
String get quick_create => 'Schnellzugriff'; String get quick_create => 'Schnellzugriff';
@override @override
String get recent_matches => 'Letzte Spiele'; String get recent_matches => 'Letzte Spiele';
@override
String get results => 'Ergebnisse';
@override @override
String get ruleset => 'Regelwerk'; String get ruleset => 'Regelwerk';
@@ -268,9 +206,6 @@ class AppLocalizationsDe extends AppLocalizations {
String get ruleset_single_winner => String get ruleset_single_winner =>
'Genau ein:e Gewinner:in wird gewählt; Unentschieden werden durch einen vordefinierten Tie-Breaker aufgelöst.'; 'Genau ein:e Gewinner:in wird gewählt; Unentschieden werden durch einen vordefinierten Tie-Breaker aufgelöst.';
@override
String get save_changes => 'Änderungen speichern';
@override @override
String get search_for_groups => 'Nach Gruppen suchen'; String get search_for_groups => 'Nach Gruppen suchen';
@@ -309,7 +244,7 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get this_cannot_be_undone => String get this_cannot_be_undone =>
'Dies kann nicht rückgängig gemacht werden.'; 'Dies kann nicht rückgängig gemacht werden';
@override @override
String get today_at => 'Heute um'; String get today_at => 'Heute um';

View File

@@ -18,10 +18,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get amount_of_matches => 'Amount of Matches'; String get amount_of_matches => 'Amount of Matches';
@override @override
String get app_name => 'Tallee'; String get app_name => 'Game Tracker';
@override
String get best_player => 'Best Player';
@override @override
String get cancel => 'Cancel'; String get cancel => 'Cancel';
@@ -49,15 +46,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get create_new_group => 'Create new group'; String get create_new_group => 'Create new group';
@override
String get created_on => 'Created on';
@override @override
String get create_new_match => 'Create new match'; String get create_new_match => 'Create new match';
@override
String get data => 'Data';
@override @override
String get data_successfully_deleted => 'Data successfully deleted'; String get data_successfully_deleted => 'Data successfully deleted';
@@ -78,30 +69,10 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get delete_all_data => 'Delete all data'; String get delete_all_data => 'Delete all data';
@override
String get delete_group => 'Delete Group';
@override
String get delete_match => 'Delete Match';
@override
String get edit_group => 'Edit Group';
@override
String get enter_results => 'Enter Results';
@override @override
String get error_creating_group => String get error_creating_group =>
'Error while creating group, please try again'; 'Error while creating group, please try again';
@override
String get error_deleting_group =>
'Error while deleting group, please try again';
@override
String get error_editing_group =>
'Error while editing group, please try again';
@override @override
String get error_reading_file => 'Error reading file'; String get error_reading_file => 'Error reading file';
@@ -126,9 +97,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get group_name => 'Group name'; String get group_name => 'Group name';
@override
String get group_profile => 'Group Profile';
@override @override
String get groups => 'Groups'; String get groups => 'Groups';
@@ -150,29 +118,17 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get least_points => 'Least Points'; String get least_points => 'Least Points';
@override
String get legal => 'Legal';
@override
String get legal_notice => 'Legal Notice';
@override
String get licenses => 'Licenses';
@override @override
String get match_in_progress => 'Match in progress...'; String get match_in_progress => 'Match in progress...';
@override @override
String get match_name => 'Match name'; String get match_name => 'Match name';
@override
String get match_profile => 'Match Profile';
@override @override
String get matches => 'Matches'; String get matches => 'Matches';
@override @override
String get members => 'Members'; String get menu => 'Menu';
@override @override
String get most_points => 'Most Points'; String get most_points => 'Most Points';
@@ -183,12 +139,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get no_groups_created_yet => 'No groups created yet'; String get no_groups_created_yet => 'No groups created yet';
@override
String get no_licenses_found => 'No licenses found';
@override
String get no_license_text_available => 'No license text available';
@override @override
String get no_matches_created_yet => 'No matches created yet'; String get no_matches_created_yet => 'No matches created yet';
@@ -205,9 +155,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get no_recent_matches_available => 'No recent matches available'; String get no_recent_matches_available => 'No recent matches available';
@override
String get no_results_entered_yet => 'No results entered yet';
@override @override
String get no_second_match_available => 'No second match available'; String get no_second_match_available => 'No second match available';
@@ -223,9 +170,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get not_available => 'Not available'; String get not_available => 'Not available';
@override
String get played_matches => 'Played Matches';
@override @override
String get player_name => 'Player name'; String get player_name => 'Player name';
@@ -237,18 +181,12 @@ class AppLocalizationsEn extends AppLocalizations {
return '$count Players'; return '$count Players';
} }
@override
String get privacy_policy => 'Privacy Policy';
@override @override
String get quick_create => 'Quick Create'; String get quick_create => 'Quick Create';
@override @override
String get recent_matches => 'Recent Matches'; String get recent_matches => 'Recent Matches';
@override
String get results => 'Results';
@override @override
String get ruleset => 'Ruleset'; String get ruleset => 'Ruleset';
@@ -268,9 +206,6 @@ class AppLocalizationsEn extends AppLocalizations {
String get ruleset_single_winner => String get ruleset_single_winner =>
'Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.'; 'Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.';
@override
String get save_changes => 'Save Changes';
@override @override
String get search_for_groups => 'Search for groups'; String get search_for_groups => 'Search for groups';
@@ -308,7 +243,7 @@ class AppLocalizationsEn extends AppLocalizations {
'There is no group matching your search'; 'There is no group matching your search';
@override @override
String get this_cannot_be_undone => 'This can\'t be undone.'; String get this_cannot_be_undone => 'This can\'t be undone';
@override @override
String get today_at => 'Today at'; String get today_at => 'Today at';

View File

@@ -1,9 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/data/db/database.dart';
import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/views/main_menu/custom_navigation_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tallee/core/custom_theme.dart';
import 'package:tallee/data/db/database.dart';
import 'package:tallee/l10n/generated/app_localizations.dart';
import 'package:tallee/presentation/views/main_menu/custom_navigation_bar.dart';
void main() { void main() {
runApp( runApp(
@@ -40,22 +40,10 @@ class GameTracker extends StatelessWidget {
primaryColor: CustomTheme.primaryColor, primaryColor: CustomTheme.primaryColor,
scaffoldBackgroundColor: CustomTheme.backgroundColor, scaffoldBackgroundColor: CustomTheme.backgroundColor,
appBarTheme: CustomTheme.appBarTheme, appBarTheme: CustomTheme.appBarTheme,
radioTheme: RadioThemeData(
fillColor: WidgetStateProperty.resolveWith<Color>((states) {
if (states.contains(WidgetState.selected)) {
return CustomTheme.primaryColor;
}
return CustomTheme.textColor;
}),
),
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
seedColor: CustomTheme.primaryColor, seedColor: CustomTheme.primaryColor,
brightness: Brightness.dark, brightness: Brightness.dark,
primary: CustomTheme.primaryColor, ).copyWith(surface: CustomTheme.backgroundColor),
onPrimary: CustomTheme.textColor,
surface: CustomTheme.backgroundColor,
onSurface: CustomTheme.textColor,
),
pageTransitionsTheme: const PageTransitionsTheme( pageTransitionsTheme: const PageTransitionsTheme(
builders: { builders: {
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),

View File

@@ -1,17 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:tallee/core/adaptive_page_route.dart'; import 'package:game_tracker/core/adaptive_page_route.dart';
import 'package:tallee/core/custom_theme.dart'; import 'package:game_tracker/core/custom_theme.dart';
import 'package:tallee/l10n/generated/app_localizations.dart'; import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:tallee/presentation/views/main_menu/group_view/group_view.dart'; import 'package:game_tracker/presentation/views/main_menu/group_view/groups_view.dart';
import 'package:tallee/presentation/views/main_menu/home_view.dart'; import 'package:game_tracker/presentation/views/main_menu/home_view.dart';
import 'package:tallee/presentation/views/main_menu/match_view/match_view.dart'; import 'package:game_tracker/presentation/views/main_menu/match_view/match_view.dart';
import 'package:tallee/presentation/views/main_menu/settings_view/settings_view.dart'; import 'package:game_tracker/presentation/views/main_menu/settings_view.dart';
import 'package:tallee/presentation/views/main_menu/statistics_view.dart'; import 'package:game_tracker/presentation/views/main_menu/statistics_view.dart';
import 'package:tallee/presentation/widgets/navbar_item.dart'; import 'package:game_tracker/presentation/widgets/navbar_item.dart';
class CustomNavigationBar extends StatefulWidget { class CustomNavigationBar extends StatefulWidget {
/// A custom navigation bar widget that provides tabbed navigation
/// between different views: Home, Matches, Groups, and Statistics.
const CustomNavigationBar({super.key}); const CustomNavigationBar({super.key});
@override @override
@@ -38,7 +36,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
), ),
KeyedSubtree( KeyedSubtree(
key: ValueKey('groups_$tabKeyCount'), key: ValueKey('groups_$tabKeyCount'),
child: const GroupView(), child: const GroupsView(),
), ),
KeyedSubtree( KeyedSubtree(
key: ValueKey('stats_$tabKeyCount'), key: ValueKey('stats_$tabKeyCount'),
@@ -73,60 +71,52 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
backgroundColor: CustomTheme.backgroundColor, backgroundColor: CustomTheme.backgroundColor,
body: tabs[currentIndex], body: tabs[currentIndex],
extendBody: true, extendBody: true,
bottomNavigationBar: Container( bottomNavigationBar: SafeArea(
height: 115, minimum: const EdgeInsets.only(bottom: 30),
decoration: BoxDecoration( child: Container(
color: CustomTheme.navBarBackgroundColor, margin: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10),
border: Border.all( decoration: BoxDecoration(
strokeAlign: BorderSide.strokeAlignOutside, borderRadius: BorderRadius.circular(24),
color: CustomTheme.boxBorderColor, color: CustomTheme.primaryColor,
width: 2,
), ),
borderRadius: const BorderRadius.only( child: ClipRRect(
topLeft: Radius.circular(30), borderRadius: BorderRadius.circular(24),
topRight: Radius.circular(30), child: SizedBox(
), height: 60,
boxShadow: [ child: Row(
BoxShadow( mainAxisAlignment: MainAxisAlignment.spaceAround,
color: Colors.black.withValues(alpha: 0.1), children: <Widget>[
blurRadius: 20, NavbarItem(
offset: const Offset(0, -5), index: 0,
isSelected: currentIndex == 0,
icon: Icons.home_rounded,
label: loc.home,
onTabTapped: onTabTapped,
),
NavbarItem(
index: 1,
isSelected: currentIndex == 1,
icon: Icons.gamepad_rounded,
label: loc.matches,
onTabTapped: onTabTapped,
),
NavbarItem(
index: 2,
isSelected: currentIndex == 2,
icon: Icons.group_rounded,
label: loc.groups,
onTabTapped: onTabTapped,
),
NavbarItem(
index: 3,
isSelected: currentIndex == 3,
icon: Icons.bar_chart_rounded,
label: loc.statistics,
onTabTapped: onTabTapped,
),
],
),
), ),
],
),
child: SafeArea(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
NavbarItem(
index: 0,
isSelected: currentIndex == 0,
icon: Icons.home_rounded,
label: loc.home,
onTabTapped: onTabTapped,
),
NavbarItem(
index: 1,
isSelected: currentIndex == 1,
icon: Icons.gamepad_rounded,
label: loc.matches,
onTabTapped: onTabTapped,
),
NavbarItem(
index: 2,
isSelected: currentIndex == 2,
icon: Icons.group_rounded,
label: loc.groups,
onTabTapped: onTabTapped,
),
NavbarItem(
index: 3,
isSelected: currentIndex == 3,
icon: Icons.bar_chart_rounded,
label: loc.statistics,
onTabTapped: onTabTapped,
),
],
), ),
), ),
), ),

View File

@@ -1,20 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/core/enums.dart';
import 'package:game_tracker/data/db/database.dart';
import 'package:game_tracker/data/dto/group.dart';
import 'package:game_tracker/data/dto/player.dart';
import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/widgets/buttons/custom_width_button.dart';
import 'package:game_tracker/presentation/widgets/player_selection.dart';
import 'package:game_tracker/presentation/widgets/text_input/text_input_field.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tallee/core/custom_theme.dart';
import 'package:tallee/core/enums.dart';
import 'package:tallee/data/db/database.dart';
import 'package:tallee/data/dto/group.dart';
import 'package:tallee/data/dto/player.dart';
import 'package:tallee/l10n/generated/app_localizations.dart';
import 'package:tallee/presentation/widgets/buttons/custom_width_button.dart';
import 'package:tallee/presentation/widgets/player_selection.dart';
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
class CreateGroupView extends StatefulWidget { class CreateGroupView extends StatefulWidget {
const CreateGroupView({super.key, this.groupToEdit}); const CreateGroupView({super.key});
/// The group to edit, if any
final Group? groupToEdit;
@override @override
State<CreateGroupView> createState() => _CreateGroupViewState(); State<CreateGroupView> createState() => _CreateGroupViewState();
@@ -23,29 +20,16 @@ class CreateGroupView extends StatefulWidget {
class _CreateGroupViewState extends State<CreateGroupView> { class _CreateGroupViewState extends State<CreateGroupView> {
late final AppDatabase db; late final AppDatabase db;
/// GlobalKey for ScaffoldMessenger to show snackbars
final _scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
/// Controller for the group name input field /// Controller for the group name input field
final _groupNameController = TextEditingController(); final _groupNameController = TextEditingController();
/// List of currently selected players /// List of currently selected players
List<Player> selectedPlayers = []; List<Player> selectedPlayers = [];
/// List of initially selected players (when editing a group)
List<Player> initialSelectedPlayers = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
db = Provider.of<AppDatabase>(context, listen: false); db = Provider.of<AppDatabase>(context, listen: false);
if (widget.groupToEdit != null) {
_groupNameController.text = widget.groupToEdit!.name;
setState(() {
initialSelectedPlayers = widget.groupToEdit!.members;
selectedPlayers = widget.groupToEdit!.members;
});
}
_groupNameController.addListener(() { _groupNameController.addListener(() {
setState(() {}); setState(() {});
}); });
@@ -61,58 +45,9 @@ class _CreateGroupViewState extends State<CreateGroupView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
return ScaffoldMessenger( return ScaffoldMessenger(
key: _scaffoldMessengerKey,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: CustomTheme.backgroundColor, backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar( appBar: AppBar(title: Text(loc.create_new_group)),
title: Text(
widget.groupToEdit == null ? loc.create_new_group : loc.edit_group,
),
actions: widget.groupToEdit == null
? []
: [
IconButton(
icon: const Icon(Icons.delete),
onPressed: () async {
if (widget.groupToEdit != null) {
showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: Text(loc.delete_group),
content: Text(loc.this_cannot_be_undone),
actions: [
TextButton(
onPressed: () =>
Navigator.of(context).pop(false),
child: Text(loc.cancel),
),
TextButton(
onPressed: () =>
Navigator.of(context).pop(true),
child: Text(loc.delete),
),
],
),
).then((confirmed) async {
if (confirmed == true && context.mounted) {
bool success = await db.groupDao.deleteGroup(
groupId: widget.groupToEdit!.id,
);
if (!context.mounted) return;
if (success) {
Navigator.pop(context);
} else {
if (!mounted) return;
showSnackbar(message: loc.error_deleting_group);
}
}
});
}
},
),
],
),
body: SafeArea( body: SafeArea(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@@ -126,7 +61,6 @@ class _CreateGroupViewState extends State<CreateGroupView> {
), ),
Expanded( Expanded(
child: PlayerSelection( child: PlayerSelection(
initialSelectedPlayers: initialSelectedPlayers,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
selectedPlayers = [...value]; selectedPlayers = [...value];
@@ -135,9 +69,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
), ),
), ),
CustomWidthButton( CustomWidthButton(
text: widget.groupToEdit == null text: loc.create_group,
? loc.create_group
: loc.edit_group,
sizeRelativeToWidth: 0.95, sizeRelativeToWidth: 0.95,
buttonType: ButtonType.primary, buttonType: ButtonType.primary,
onPressed: onPressed:
@@ -145,37 +77,28 @@ class _CreateGroupViewState extends State<CreateGroupView> {
(selectedPlayers.length < 2)) (selectedPlayers.length < 2))
? null ? null
: () async { : () async {
late Group? updatedGroup; bool success = await db.groupDao.addGroup(
late bool success; group: Group(
if (widget.groupToEdit == null) {
success = await db.groupDao.addGroup(
group: Group(
name: _groupNameController.text.trim(),
members: selectedPlayers,
),
);
} else {
updatedGroup = Group(
id: widget.groupToEdit!.id,
name: _groupNameController.text.trim(), name: _groupNameController.text.trim(),
members: selectedPlayers, members: selectedPlayers,
); ),
//TODO: Implement group editing in database );
/*
success = await db.groupDao.updateGroup(
group: updatedGroup,
);
*/
success = true;
}
if (!context.mounted) return; if (!context.mounted) return;
if (success) { if (success) {
Navigator.pop(context, updatedGroup); Navigator.pop(context);
} else { } else {
showSnackbar( ScaffoldMessenger.of(context).showSnackBar(
message: widget.groupToEdit == null SnackBar(
? loc.error_creating_group backgroundColor: CustomTheme.boxColor,
: loc.error_editing_group, content: Center(
child: Text(
AppLocalizations.of(
context,
).error_creating_group,
style: const TextStyle(color: Colors.white),
),
),
),
); );
} }
}, },
@@ -187,20 +110,4 @@ class _CreateGroupViewState extends State<CreateGroupView> {
), ),
); );
} }
/// Displays a snackbar with the given message and optional action.
///
/// [message] The message to display in the snackbar.
void showSnackbar({required String message}) {
final messenger = _scaffoldMessengerKey.currentState;
if (messenger != null) {
messenger.hideCurrentSnackBar();
messenger.showSnackBar(
SnackBar(
content: Text(message, style: const TextStyle(color: Colors.white)),
backgroundColor: CustomTheme.boxColor,
),
);
}
}
} }

Some files were not shown because too many files have changed in this diff Show More