// PowerClampModel class to represent the response class PowerClampModel { String productUuid; String productType; PowerStatus status; PowerClampModel({ required this.productUuid, required this.productType, required this.status, }); factory PowerClampModel.fromJson(Map json) { return PowerClampModel( productUuid: json['productUuid'], productType: json['productType'], status: PowerStatus.fromJson(json['status']), ); } } class PowerStatus { Phase phaseA; Phase phaseB; Phase phaseC; Phase general; PowerStatus({ required this.phaseA, required this.phaseB, required this.phaseC, required this.general, }); factory PowerStatus.fromJson(Map json) { return PowerStatus( phaseA: Phase.fromJson(json['phaseA']), phaseB: Phase.fromJson(json['phaseB']), phaseC: Phase.fromJson(json['phaseC']), general: Phase.fromJson(json['general'] // List.from( // json['general'].map((x) => DataPoint.fromJson(x))), )); } } class Phase { List dataPoints; Phase({required this.dataPoints}); factory Phase.fromJson(List json) { return Phase( dataPoints: json.map((x) => DataPoint.fromJson(x)).toList(), ); } } class DataPoint { dynamic code; dynamic customName; dynamic dpId; dynamic time; dynamic type; dynamic value; DataPoint({ required this.code, required this.customName, required this.dpId, required this.time, required this.type, required this.value, }); factory DataPoint.fromJson(Map json) { return DataPoint( code: json['code'], customName: json['customName'], dpId: json['dpId'], time: json['time'], type: json['type'], value: json['value'], ); } }