Simplyfing methods

This commit is contained in:
2025-06-08 20:47:10 +02:00
parent 0e1a6cdeaf
commit 11aa7494f3
3 changed files with 2 additions and 12 deletions

View File

@@ -118,7 +118,7 @@ class _MainMenuViewState extends State<MainMenuView> {
return await _showDeleteGamePopup(gameTitle);
},
onDismissed: (direction) {
_deleteSpecificGame(index);
gameManager.removeGameSession(index);
},
dismissThresholds: const {
DismissDirection.startToEnd: 0.6
@@ -215,12 +215,4 @@ class _MainMenuViewState extends State<MainMenuView> {
false;
return shouldDelete;
}
/// Deletes a specific game session by its index.
/// This function takes an [index] as parameter and removes the game session at
/// that index from the global game list,
void _deleteSpecificGame(int index) {
gameManager.gameList.removeAt(index);
LocalStorageService.saveGameSessions();
}
}