Small changes
This commit is contained in:
@@ -46,14 +46,13 @@ class LocalStorageService {
|
|||||||
print('Es existiert bereits eine Datei mit Spieldaten');
|
print('Es existiert bereits eine Datei mit Spieldaten');
|
||||||
final jsonString = await file.readAsString();
|
final jsonString = await file.readAsString();
|
||||||
if (jsonString.isNotEmpty) {
|
if (jsonString.isNotEmpty) {
|
||||||
print('Die Datei ist nicht leer');
|
print('Die gefundene Datei ist nicht leer');
|
||||||
final jsonList = json.decode(jsonString) as List<dynamic>;
|
final jsonList = json.decode(jsonString) as List<dynamic>;
|
||||||
print('JSON: $jsonList');
|
|
||||||
Globals.gameList = jsonList
|
Globals.gameList = jsonList
|
||||||
.map((jsonItem) =>
|
.map((jsonItem) =>
|
||||||
GameSession.fromJson(jsonItem as Map<String, dynamic>))
|
GameSession.fromJson(jsonItem as Map<String, dynamic>))
|
||||||
.toList()
|
.toList()
|
||||||
.cast<GameSession>(); // Explicit cast to List<GameSession>
|
.cast<GameSession>();
|
||||||
print('Die Daten wurden erfolgreich geladen');
|
print('Die Daten wurden erfolgreich geladen');
|
||||||
} else {
|
} else {
|
||||||
print('Die Datei ist leer');
|
print('Die Datei ist leer');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.1.5+108
|
version: 0.1.5+110
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user