mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
33 lines
806 B
Dart
33 lines
806 B
Dart
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
|
|
|
|
class CurtainModel {
|
|
final String productUuid;
|
|
final String productType;
|
|
final List<Status> status;
|
|
|
|
CurtainModel({
|
|
required this.productUuid,
|
|
required this.productType,
|
|
required this.status,
|
|
});
|
|
|
|
factory CurtainModel.fromJson(dynamic json) {
|
|
var statusList = json['status'] as List;
|
|
List<Status> status = statusList.map((i) => Status.fromJson(i)).toList();
|
|
|
|
return CurtainModel(
|
|
productUuid: json['productUuid'],
|
|
productType: json['productType'],
|
|
status: status,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'productUuid': productUuid,
|
|
'productType': productType,
|
|
'status': status.map((s) => s.toJson()).toList(),
|
|
};
|
|
}
|
|
}
|