mapFromJson static method
Implementation
static Map<String, Device> mapFromJson(Map<String, dynamic>? json) {
if (json == null) {
return <String, Device>{};
}
return json.entries.fold(<String, Device>{},
(Map<String, Device> previousValue, element) {
final Device? object = Device.fromJson(element.value);
if (object is Device) {
previousValue[element.key] = object;
}
return previousValue;
});
}