fix: single result row
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 49s
Pull Request Pipeline / lint (pull_request) Successful in 50s

This commit is contained in:
2026-05-10 18:47:48 +02:00
parent 341b293151
commit 50bf111f03

View File

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