Implementierung von multiple Winners #214

Merged
flixcoo merged 17 commits from feature/205-Implementierung-von-multipleWinners into development 2026-05-10 17:13:11 +00:00
Showing only changes of commit 50bf111f03 - Show all commits

View File

@@ -283,11 +283,13 @@ class _MatchDetailViewState extends State<MatchDetailView> {
/// Returns the result row for single winner/loser rulesets or a placeholder /// Returns the result row for single winner/loser rulesets or a placeholder
/// if no result is entered yet /// if no result is entered yet
List<Widget> getSingleResultRow(AppLocalizations loc) { List<Widget> getSingleResultRow(AppLocalizations loc) {
// Single Winner if (match.mvp.isNotEmpty) {
if (match.mvp.isNotEmpty && match.game.ruleset == Ruleset.singleWinner) { final ruleset = match.game.ruleset;
if (ruleset == Ruleset.singleWinner || ruleset == Ruleset.singleLoser) {
return [ return [
Text( Text(
loc.winner, ruleset == Ruleset.singleWinner ? loc.winner : loc.loser,
style: const TextStyle(fontSize: 16, color: CustomTheme.textColor), style: const TextStyle(fontSize: 16, color: CustomTheme.textColor),
), ),
Text( Text(
@@ -299,26 +301,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
), ),
), ),
]; ];
// Single Loser } else if (match.game.ruleset == Ruleset.multipleWinners) {
} else if (match.mvp.isNotEmpty &&
match.game.ruleset == Ruleset.singleLoser) {
return [
Text(
loc.loser,
style: const TextStyle(fontSize: 16, color: CustomTheme.textColor),
),
Text(
match.mvp.first.name,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: CustomTheme.primaryColor,
),
),
];
// Multiple Winners
} else if (match.mvp.isNotEmpty &&
match.game.ruleset == Ruleset.multipleWinners) {
return [ return [
Text( Text(
loc.winners, loc.winners,
@@ -339,8 +322,10 @@ class _MatchDetailViewState extends State<MatchDetailView> {
), ),
), ),
]; ];
// No result entered yet }
} else { }
// No results yet
return [ return [
Text( Text(
loc.no_results_entered_yet, loc.no_results_entered_yet,
@@ -348,7 +333,6 @@ class _MatchDetailViewState extends State<MatchDetailView> {
), ),
]; ];
} }
}
/// Returns the result widget for scores or placement /// Returns the result widget for scores or placement
Widget getMultiResultRows(AppLocalizations loc) { Widget getMultiResultRows(AppLocalizations loc) {