import 'NotificationDTO.dart'; class NotificationObjectDTO { int numberUnreadPage; int numberReadPage; int numberUnreadTotal; int numberReadTotal; List notificationDTO; NotificationObjectDTO( {this.numberUnreadPage, this.numberReadPage, this.numberUnreadTotal, this.numberReadTotal, this.notificationDTO}); NotificationObjectDTO.fromJson(Map json) { numberUnreadPage = json['numberUnreadPage']; numberReadPage = json['numberReadPage']; numberUnreadTotal = json['numberUnreadTotal']; numberReadTotal = json['numberReadTotal']; if (json['tbnotificationDTOs'] != null) { notificationDTO = new List(); json['tbnotificationDTOs'].forEach((v) { notificationDTO.add(new NotificationDTO.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['numberUnreadPage'] = this.numberUnreadPage; data['numberReadPage'] = this.numberReadPage; data['numberUnreadTotal'] = this.numberUnreadTotal; data['numberReadTotal'] = this.numberReadTotal; if (this.notificationDTO != null) { data['tbnotificationDTOs'] = this.notificationDTO.map((v) => v.toJson()).toList(); } return data; } }