add: empty game list messages
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 46s
Pull Request Pipeline / lint (pull_request) Successful in 53s

This commit is contained in:
2026-05-09 15:01:21 +02:00
parent df757af7ec
commit f9eafa5b3d
6 changed files with 107 additions and 55 deletions

View File

@@ -80,6 +80,7 @@
"members": "Mitglieder",
"most_points": "Höchste Punkte",
"no_data_available": "Keine Daten verfügbar",
"no_games_created_yet": "Noch keine Spielvorlagen erstellt",
"no_groups_created_yet": "Noch keine Gruppen erstellt",
"no_licenses_found": "Keine Lizenzen gefunden",
"no_license_text_available": "Kein Lizenztext verfügbar",
@@ -125,6 +126,7 @@
"statistics": "Statistiken",
"stats": "Statistiken",
"successfully_added_player": "Spieler:in {playerName} erfolgreich hinzugefügt",
"there_are_no_games_matching_your_search": "Es gibt keine Spielvorlagen, die deiner Suche entspricht",
"there_is_no_group_matching_your_search": "Es gibt keine Gruppe, die deiner Suche entspricht",
"this_cannot_be_undone": "Dies kann nicht rückgängig gemacht werden.",
"tie": "Unentschieden",

View File

@@ -81,6 +81,7 @@
"members": "Members",
"most_points": "Most Points",
"no_data_available": "No data available",
"no_games_created_yet": "No games created yet",
"no_groups_created_yet": "No groups created yet",
"no_licenses_found": "No licenses found",
"no_license_text_available": "No license text available",
@@ -134,6 +135,7 @@
}
}
},
"there_are_no_games_matching_your_search": "There are no games matching your search",
"there_is_no_group_matching_your_search": "There is no group matching your search",
"this_cannot_be_undone": "This can't be undone.",
"tie": "Tie",

View File

@@ -536,6 +536,12 @@ abstract class AppLocalizations {
/// **'No data available'**
String get no_data_available;
/// No description provided for @no_games_created_yet.
///
/// In en, this message translates to:
/// **'No games created yet'**
String get no_games_created_yet;
/// No description provided for @no_groups_created_yet.
///
/// In en, this message translates to:
@@ -800,6 +806,12 @@ abstract class AppLocalizations {
/// **'Successfully added player {playerName}'**
String successfully_added_player(String playerName);
/// No description provided for @there_are_no_games_matching_your_search.
///
/// In en, this message translates to:
/// **'There are no games matching your search'**
String get there_are_no_games_matching_your_search;
/// No description provided for @there_is_no_group_matching_your_search.
///
/// In en, this message translates to:

View File

@@ -243,6 +243,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get no_data_available => 'Keine Daten verfügbar';
@override
String get no_games_created_yet => 'Noch keine Spielvorlagen erstellt';
@override
String get no_groups_created_yet => 'Noch keine Gruppen erstellt';
@@ -382,6 +385,10 @@ class AppLocalizationsDe extends AppLocalizations {
return 'Spieler:in $playerName erfolgreich hinzugefügt';
}
@override
String get there_are_no_games_matching_your_search =>
'Es gibt keine Spielvorlagen, die deiner Suche entspricht';
@override
String get there_is_no_group_matching_your_search =>
'Es gibt keine Gruppe, die deiner Suche entspricht';

View File

@@ -243,6 +243,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get no_data_available => 'No data available';
@override
String get no_games_created_yet => 'No games created yet';
@override
String get no_groups_created_yet => 'No groups created yet';
@@ -382,6 +385,10 @@ class AppLocalizationsEn extends AppLocalizations {
return 'Successfully added player $playerName';
}
@override
String get there_are_no_games_matching_your_search =>
'There are no games matching your search';
@override
String get there_is_no_group_matching_your_search =>
'There is no group matching your search';

View File

@@ -9,6 +9,7 @@ import 'package:tallee/l10n/generated/app_localizations.dart';
import 'package:tallee/presentation/views/main_menu/match_view/create_match/create_game_view.dart';
import 'package:tallee/presentation/widgets/text_input/custom_search_bar.dart';
import 'package:tallee/presentation/widgets/tiles/game_tile.dart';
import 'package:tallee/presentation/widgets/top_centered_message.dart';
class ChooseGameView extends StatefulWidget {
/// A view that allows the user to choose a game from a list of available games
@@ -134,6 +135,23 @@ class _ChooseGameViewState extends State<ChooseGameView> {
// Game list
Expanded(
child: Visibility(
visible: filteredGames.isNotEmpty,
replacement: Visibility(
visible: widget.games.isNotEmpty,
replacement: TopCenteredMessage(
icon: Icons.info,
title: loc.info,
message: loc.no_games_created_yet,
),
child: TopCenteredMessage(
icon: Icons.info,
title: loc.info,
message: AppLocalizations.of(
context,
).there_are_no_games_matching_your_search,
),
),
child: ListView.builder(
itemCount: filteredGames.length,
itemBuilder: (BuildContext context, int index) {
@@ -141,7 +159,10 @@ class _ChooseGameViewState extends State<ChooseGameView> {
return GameTile(
title: game.name,
description: game.description,
badgeText: translateRulesetToString(game.ruleset, context),
badgeText: translateRulesetToString(
game.ruleset,
context,
),
badgeColor: getColorFromGameColor(game.color),
isHighlighted: selectedGameId == game.id,
onTap: () async {
@@ -195,6 +216,7 @@ class _ChooseGameViewState extends State<ChooseGameView> {
},
),
),
),
],
),
),