class AllRequestsAndCount { CountServiceRequest countServiceRequest; CountServiceRequest countGasRefill; CountServiceRequest countAssetTransfer; CountServiceRequest countPPM; DetailsStatusTotal detailsStatusTotal; CountServiceRequest total; List requestsDetails; AllRequestsAndCount({this.countServiceRequest, this.countGasRefill, this.countAssetTransfer, this.countPPM, this.detailsStatusTotal, this.total, this.requestsDetails}); AllRequestsAndCount.fromJson(Map json) { countServiceRequest = json['countServiceRequest'] != null ? new CountServiceRequest.fromJson(json['countServiceRequest']) : null; countGasRefill = json['countGasRefill'] != null ? new CountServiceRequest.fromJson(json['countGasRefill']) : null; countAssetTransfer = json['countAssetTransfer'] != null ? new CountServiceRequest.fromJson(json['countAssetTransfer']) : null; countPPM = json['countPPM'] != null ? new CountServiceRequest.fromJson(json['countPPM']) : null; detailsStatusTotal = json['detailsStatusTotal'] != null ? new DetailsStatusTotal.fromJson(json['detailsStatusTotal']) : null; total = json['total'] != null ? new CountServiceRequest.fromJson(json['total']) : null; if (json['requestsDetails'] != null) { requestsDetails = []; json['requestsDetails'].forEach((v) { requestsDetails.add(new RequestsDetails.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); if (this.countServiceRequest != null) { data['countServiceRequest'] = this.countServiceRequest.toJson(); } if (this.countGasRefill != null) { data['countGasRefill'] = this.countGasRefill.toJson(); } if (this.countAssetTransfer != null) { data['countAssetTransfer'] = this.countAssetTransfer.toJson(); } if (this.countPPM != null) { data['countPPM'] = this.countPPM.toJson(); } if (this.detailsStatusTotal != null) { data['detailsStatusTotal'] = this.detailsStatusTotal.toJson(); } if (this.total != null) { data['total'] = this.total.toJson(); } if (this.requestsDetails != null) { data['requestsDetails'] = this.requestsDetails.map((v) => v.toJson()).toList(); } return data; } } class CountServiceRequest { int count; CountServiceRequest({this.count}); CountServiceRequest.fromJson(Map json) { count = json['count']; } Map toJson() { final Map data = new Map(); data['count'] = this.count; return data; } } class DetailsStatusTotal { int open; int inProgress; int closed; DetailsStatusTotal({this.open, this.inProgress, this.closed}); DetailsStatusTotal.fromJson(Map json) { open = json['open']; inProgress = json['inProgress']; closed = json['closed']; } Map toJson() { final Map data = new Map(); data['open'] = this.open; data['inProgress'] = this.inProgress; data['closed'] = this.closed; return data; } } class RequestsDetails { int id; String nameOfType; String priority; String status; String assetName; String assetNo; String assetSN; String model; String supplier; String manufacturer; String requestType; String requestNo; String gasType; String site; String statusReceiver; String assetTransferFrom; String assetTransferTo; String code; String date; RequestsDetails( {this.id, this.nameOfType, this.priority, this.status, this.assetName, this.assetNo, this.assetSN, this.model, this.supplier, this.manufacturer, this.requestType, this.requestNo, this.gasType, this.site, this.statusReceiver, this.assetTransferFrom, this.assetTransferTo, this.code, this.date}); RequestsDetails.fromJson(Map json) { id = json['id']; nameOfType = json['nameOfType']; priority = json['priority']; status = json['status']; assetName = json['assetName']; assetNo = json['assetNo']; assetSN = json['assetSN']; model = json['model']; supplier = json['supplier']; manufacturer = json['manufacturer']; requestType = json['requestType']; requestNo = json['requestNo']; gasType = json['gasType']; site = json['site']; statusReceiver = json['statusReceiver']; assetTransferFrom = json['assetTransferFrom']; assetTransferTo = json['assetTransferTo']; code = json['code']; date = json['date']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['nameOfType'] = this.nameOfType; data['priority'] = this.priority; data['status'] = this.status; data['assetName'] = this.assetName; data['assetNo'] = this.assetNo; data['assetSN'] = this.assetSN; data['model'] = this.model; data['supplier'] = this.supplier; data['manufacturer'] = this.manufacturer; data['requestType'] = this.requestType; data['requestNo'] = this.requestNo; data['gasType'] = this.gasType; data['site'] = this.site; data['statusReceiver'] = this.statusReceiver; data['assetTransferFrom'] = this.assetTransferFrom; data['assetTransferTo'] = this.assetTransferTo; data['code'] = this.code; data['date'] = this.date; return data; } }