home controller file picker

This commit is contained in:
atseirjo
2026-01-22 06:52:41 +01:00
parent 7faa64eeb0
commit f25368e532
2 changed files with 3 additions and 4 deletions

View File

@@ -67,8 +67,7 @@ class HomeController extends GetxController {
try { try {
// Datei auswählen // Datei auswählen
FilePickerResult? result = await FilePicker.platform.pickFiles( FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.custom, type: FileType.any,
allowedExtensions: ['json'],
); );
if (result != null) { if (result != null) {

View File

@@ -36,7 +36,6 @@ class FilamentRepository extends GetxService {
final data = _storage.read(_storageKey); final data = _storage.read(_storageKey);
//Wenn nichts gespeichert ist, gebe die Mockup Liste zurück //Wenn nichts gespeichert ist, gebe die Mockup Liste zurück
if (data == null) return FilamentModel.mockupFilamentList; if (data == null) return FilamentModel.mockupFilamentList;
return (data as List) return (data as List)
.map((json) => FilamentModel.fromJson(json)) .map((json) => FilamentModel.fromJson(json))
.toList(); .toList();
@@ -152,4 +151,5 @@ class FilamentRepository extends GetxService {
final filaments = getAllFilaments(); final filaments = getAllFilaments();
return filaments.where((f) => f.type == type).toList(); return filaments.where((f) => f.type == type).toList();
} }
} }