cleanup
This commit is contained in:
parent
d08fd52e51
commit
343ac025d5
@ -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);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user