Simplyfing methods
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user