Update statistics_view.dart to use localized 'not available' message for players

This commit is contained in:
2026-01-01 18:31:53 +01:00
parent 3c3bf506cb
commit d77b5f20f9

View File

@@ -152,7 +152,10 @@ class _StatisticsViewState extends State<StatisticsView> {
final playerId = winCounts[i].$1; final playerId = winCounts[i].$1;
final player = players.firstWhere( final player = players.firstWhere(
(p) => p.id == playerId, (p) => p.id == playerId,
orElse: () => Player(id: playerId, name: 'N.a.'), orElse: () => Player(
id: playerId,
name: AppLocalizations.of(context)!.not_available,
),
); );
winCounts[i] = (player.name, winCounts[i].$2); winCounts[i] = (player.name, winCounts[i].$2);
} }
@@ -214,7 +217,10 @@ class _StatisticsViewState extends State<StatisticsView> {
final playerId = matchCounts[i].$1; final playerId = matchCounts[i].$1;
final player = players.firstWhere( final player = players.firstWhere(
(p) => p.id == playerId, (p) => p.id == playerId,
orElse: () => Player(id: playerId, name: 'N.a.'), orElse: () => Player(
id: playerId,
name: AppLocalizations.of(context)!.not_available,
),
); );
matchCounts[i] = (player.name, matchCounts[i].$2); matchCounts[i] = (player.name, matchCounts[i].$2);
} }