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 = []; json['tbnotificationDTOs'].forEach((v) { notificationDTO?.add(NotificationDTO.fromJson(v)); }); } } Map toJson() { final data = {}; data['numberUnreadPage'] = numberUnreadPage; data['numberReadPage'] = numberReadPage; data['numberUnreadTotal'] = numberUnreadTotal; data['numberReadTotal'] = numberReadTotal; if (notificationDTO != null) { data['tbnotificationDTOs'] = notificationDTO?.map((v) => v.toJson()).toList(); } return data; } }