home controller file picker
This commit is contained in:
@@ -67,8 +67,7 @@ class HomeController extends GetxController {
|
||||
try {
|
||||
// Datei auswählen
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['json'],
|
||||
type: FileType.any,
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
|
||||
@@ -36,7 +36,6 @@ class FilamentRepository extends GetxService {
|
||||
final data = _storage.read(_storageKey);
|
||||
//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();
|
||||
@@ -152,4 +151,5 @@ class FilamentRepository extends GetxService {
|
||||
final filaments = getAllFilaments();
|
||||
return filaments.where((f) => f.type == type).toList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user