Added icons to rulesets
Some checks failed
Pull Request Pipeline / test (pull_request) Successful in 45s
Pull Request Pipeline / lint (pull_request) Failing after 47s

This commit is contained in:
2026-05-04 11:09:05 +02:00
parent b53facc16c
commit a9b86fe7ff
2 changed files with 30 additions and 6 deletions

View File

@@ -66,6 +66,22 @@ Color getColorFromGameColor(GameColor color) {
}
}
/// Returns [IconData] corresponding to a [Ruleset] enum value.
IconData getRulesetIcon(Ruleset ruleset) {
switch (ruleset) {
case Ruleset.highestScore:
return Icons.arrow_upward;
case Ruleset.lowestScore:
return Icons.arrow_downward;
case Ruleset.singleWinner:
return Icons.emoji_events;
case Ruleset.singleLoser:
return Icons.sentiment_dissatisfied;
case Ruleset.multipleWinners:
return Icons.group;
}
}
/// Counts how many players in the [match] are not part of the group
///
/// Returns the text you append after the group name, e.g. " + 5" or an empty