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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user