This commit is contained in:
Scott E. Graves 2025-03-15 11:25:51 -05:00
parent d08fd52e51
commit 343ac025d5
2 changed files with 4 additions and 6 deletions

View File

@ -53,9 +53,11 @@ class MountList with ChangeNotifier {
} }
List<Mount> nextList = []; List<Mount> nextList = [];
jsonDecode(response.body).forEach((key, value) { jsonDecode(response.body).forEach((type, value) {
nextList.addAll( nextList.addAll(
value.map((name) => Mount(MountConfig.fromJson(key, name))).toList(), value
.map((name) => Mount(MountConfig(type: type, name: name)))
.toList(),
); );
}); });
_sort(nextList); _sort(nextList);

View File

@ -25,10 +25,6 @@ class MountConfig {
IconData? get state => _state; IconData? get state => _state;
String get type => _type; String get type => _type;
factory MountConfig.fromJson(String type, String name) {
return MountConfig(name: name, type: type);
}
void updateSettings(Map<String, dynamic> settings) { void updateSettings(Map<String, dynamic> settings) {
_settings = settings; _settings = settings;
} }