WIP: Bearbeiten und Löschen von Matches #171

Draft
flixcoo wants to merge 35 commits from feature/120-bearbeiten-und-loeschen-von-matches into development
6 changed files with 44 additions and 19 deletions
Showing only changes of commit eb114f2853 - Show all commits

View File

@@ -61,6 +61,7 @@
"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",

View File

@@ -188,6 +188,9 @@
"@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"
}, },
@@ -371,6 +374,7 @@
"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",

View File

@@ -464,6 +464,12 @@ 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:

View File

@@ -197,6 +197,9 @@ 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';

View File

@@ -197,6 +197,9 @@ 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';

View File

@@ -51,10 +51,6 @@ class _MatchProfileViewState extends State<MatchProfileView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
final extraPlayersCount =
(widget.match.players?.length ?? 0) +
(widget.match.group?.members.length ?? 0) -
allPlayers.length;
return Scaffold( return Scaffold(
backgroundColor: CustomTheme.backgroundColor, backgroundColor: CustomTheme.backgroundColor,
@@ -144,6 +140,7 @@ class _MatchProfileViewState extends State<MatchProfileView> {
const Icon(Icons.group), const Icon(Icons.group),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
// TODO: Update after DB changes
'${widget.match.group!.name} ${widget.match.players != null ? '+ ${widget.match.players!.length}' : ''}', '${widget.match.group!.name} ${widget.match.players != null ? '+ ${widget.match.players!.length}' : ''}',
style: const TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
), ),
@@ -180,23 +177,34 @@ class _MatchProfileViewState extends State<MatchProfileView> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( /// TODO: Implement different ruleset results display
loc.winner, if (widget.match.winner != null) ...[
style: const TextStyle( Text(
fontSize: 16, loc.winner,
color: CustomTheme.textColor, style: const TextStyle(
fontSize: 16,
color: CustomTheme.textColor,
),
), ),
), Text(
Text( widget.match.winner?.name ?? '-',
widget.match.winner?.name ?? '-', style: TextStyle(
style: TextStyle( fontSize: 16,
fontSize: 16, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, color: widget.match.winner != null
color: widget.match.winner != null ? CustomTheme.primaryColor
? CustomTheme.primaryColor : CustomTheme.textColor,
: CustomTheme.textColor, ),
), ),
), ] else ...[
Text(
loc.no_results_entered_yet,
style: const TextStyle(
fontSize: 14,
color: CustomTheme.textColor,
),
),
],
], ],
), ),
), ),