Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Fix: Added second button to GamesNotFound view (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
89pleasure committed Jun 17, 2023
1 parent b60df3b commit 1b16c29
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 11 deletions.
1 change: 1 addition & 0 deletions assets/translations/de-DE.json
Expand Up @@ -6,6 +6,7 @@
"no_games_found_text": "Es scheint als hättest du deinem Emulator noch keine Spiele hinzugefügt.",
"no_games_found_hint_text": "Wähle den internen Applikationsordner des Emulators aus. \nUm den Ordner zu finden klicke auf \"Öffne {emulatorName} Ordner\" im Menü des Emulators.",
"no_games_found_button": "Neu laden",
"no_games_found_button_update": "Einstellungen anpasssen",

"hour": {
"zero": "Stunden",
Expand Down
1 change: 1 addition & 0 deletions assets/translations/en-US.json
Expand Up @@ -6,6 +6,7 @@
"no_games_found_text": "It seems you haven't added any games to your emulator yet.",
"no_games_found_hint_text": "Select the internal application folder of the emulator.\nTo find the folder click on \"Open {emulatorName} folder\" in the emulator menu.",
"no_games_found_button": "Reload",
"no_games_found_button_update": "Edit settings",

"hour": {
"zero": "hours",
Expand Down
3 changes: 2 additions & 1 deletion assets/translations/es-ES.json
Expand Up @@ -5,5 +5,6 @@
"no_games_found_title": "¡Uy, qué putada!",
"no_games_found_text": "Parece que aún no has añadido ningún juego a tu emulador",
"no_games_found_hint_text": "Seleccione la carpeta interna de aplicaciones del emulador.\nPara encontrar la carpeta, haz clic en \"Abrir {emulatorName} carpeta\" en el menú del emulador.",
"no_games_found_button": "Recargar"
"no_games_found_button": "Recargar",
"no_games_found_button_update": "Ajustar la configuración"
}
3 changes: 2 additions & 1 deletion assets/translations/fr-FR.json
Expand Up @@ -5,5 +5,6 @@
"no_games_found_title" : "Oups, quelle malchance",
"no_games_found_text" : "Il semble que tu n'aies pas encore ajouté de jeux à ton émulateur",
"no_games_found_hint_text": "Sélectionne le dossier d'application interne de l'émulateur.\nPour trouver le dossier, clique sur \"Ouvrir {emulatorName} dossier\" dans le menu de l'émulateur.",
"no_games_found_button" : "Recharger"
"no_games_found_button" : "Recharger",
"no_games_found_button_update": "Personnaliser les paramètres"
}
3 changes: 2 additions & 1 deletion assets/translations/it-IT.json
Expand Up @@ -5,5 +5,6 @@
"no_games_found_title": "Oops, che sfiga!",
"no_games_found_text": "Sembra che tu non abbia ancora aggiunto alcun gioco al tuo emulatore",
"no_games_found_hint_text": "Selezionate la cartella interna dell'applicazione dell'emulatore.\nPer trovare la cartella, fate clic su \"Apri {emulatorName} cartella\" nel menu dell'emulatore.",
"no_games_found_button": "Ricarica"
"no_games_found_button": "Ricarica",
"no_games_found_button_update": "Regolare le impostazioni"
}
3 changes: 2 additions & 1 deletion assets/translations/pt-BR.json
Expand Up @@ -5,5 +5,6 @@
"no_games_found_title": "Oops, que chatice!",
"no_games_found_text": "Parece que você ainda não adicionou nenhum jogo ao seu emulador",
"no_games_found_hint_text": "Selecione a pasta do aplicativo interno do emulador.\nPara encontrar a pasta, clique em \"Abrir {emulatorName} pasta\" no menu do emulador.",
"no_games_found_button": "Recarregar"
"no_games_found_button": "Recarregar",
"no_games_found_button_update": "Ajustar as configurações"
}
3 changes: 2 additions & 1 deletion assets/translations/pt-PT.json
Expand Up @@ -5,5 +5,6 @@
"no_games_found_title": "Oops, que chatice!",
"no_games_found_text": "Parece que ainda não adicionou nenhum jogo ao seu emulador",
"no_games_found_hint_text": "Seleccione a pasta da aplicação interna do emulador.\nPara localizar a pasta, clique em \"Abrir {emulatorName} pasta\" no menu do emulador.",
"no_games_found_button": "Recarregar"
"no_games_found_button": "Recarregar",
"no_games_found_button_update": "Ajustar as definições"
}
21 changes: 18 additions & 3 deletions lib/src/screen/games/game_list_empty_view.dart
Expand Up @@ -35,9 +35,24 @@ class GameListEmptyView extends ConsumerWidget {
const SizedBox(
height: 20.0,
),
MMElevatedButton.primary(
onPressed: () => ref.invalidate(gameListProvider),
child: Text('no_games_found_button'.tr()),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: MMElevatedButton.primary(
onPressed: () => ref.invalidate(gameListProvider),
child: Text('no_games_found_button'.tr()),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: MMElevatedButton.secondary(
onPressed: () => ref.invalidate(gameListProvider),
child: Text('no_games_found_button_update'.tr()),
),
),
],
),
],
),
Expand Down
3 changes: 3 additions & 0 deletions lib/src/screen/games/game_list_view.dart
Expand Up @@ -57,6 +57,8 @@ class GameListView extends HookConsumerWidget {
const GameListActionBarWidget(),
Expanded(
child: games.when(
skipLoadingOnRefresh: false,
skipLoadingOnReload: false,
loading: () => MMLoadingIndicator(),
error: ((error, stackTrace) {
Sentry.captureException(error, stackTrace: stackTrace);
Expand Down Expand Up @@ -122,6 +124,7 @@ class GameListView extends HookConsumerWidget {
},
);
}

return const GameListEmptyView();
}
}
3 changes: 0 additions & 3 deletions lib/src/service/emulator.dart
Expand Up @@ -96,8 +96,5 @@ class EmulatorService {
return;
}
}

// Clear selected emulator after no valid path to emulator found
ref.read(selectedEmulatorProvider.notifier).clear();
}
}

0 comments on commit 1b16c29

Please sign in to comment.