mockup and List View in a Modern Design
This commit is contained in:
@@ -34,14 +34,16 @@ class FilamentRepository extends GetxService {
|
||||
List<FilamentModel> getAllFilaments() {
|
||||
try {
|
||||
final data = _storage.read(_storageKey);
|
||||
if (data == null) return [];
|
||||
//Wenn nichts gespeichert ist, gebe die Mockup Liste zurück
|
||||
if (data == null) return FilamentModel.mockupFilamentList;
|
||||
|
||||
return (data as List)
|
||||
.map((json) => FilamentModel.fromJson(json))
|
||||
.toList();
|
||||
} catch (e) {
|
||||
print('Error reading filaments: $e');
|
||||
return [];
|
||||
// Bei Fehlerfall gebe die Mockup Liste zurück
|
||||
return FilamentModel.mockupFilamentList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user