mockup and List View in a Modern Design

This commit is contained in:
2026-01-14 14:15:37 +01:00
parent cc849be7c4
commit c065748225
10 changed files with 841 additions and 15 deletions

View File

@@ -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;
}
}

View File

@@ -1,6 +1,7 @@
import 'package:get/get.dart';
import '../controllers/home_controller.dart';
import '../controllers/list_controller.dart';
@@ -9,6 +10,7 @@ class SampleBindings extends Bindings {
void dependencies() {
// Define your dependencies here no permanent Binding
Get.lazyPut<HomeController>(() => HomeController());
Get.lazyPut<ListController>(() => ListController());
}
}

View File

@@ -1,6 +1,7 @@
import 'package:get/get.dart';
import '../pages/home_view.dart';
import 'sample_bindings.dart';
import '../pages/home_view.dart';
import '../pages/list_view.dart';
@@ -13,6 +14,11 @@ class SampleRouts {
page: () => const HomePage(),
binding: sampleBindings,
),
GetPage(
name: ListPage.namedRoute,
page: () => const ListPage(),
binding: sampleBindings,
),
];