class NotificationModel { String? id; String? title; String? msg; String? addedFor; String? createdAt; String? updatedAt; int? v; NotificationModel({ this.id, this.title, this.msg, this.addedFor, this.createdAt, this.updatedAt, this.v, }); factory NotificationModel.fromJson(Map json) { return NotificationModel( id: json['_id'], title: json['title'], msg: json['msg'], addedFor: json['added_for'], createdAt: json['createdAt'], updatedAt: json['updatedAt'], v: json['__v'], ); } Map toJson() { return { '_id': id, 'title': title, 'msg': msg, 'added_for': addedFor, 'createdAt': createdAt, 'updatedAt': updatedAt, '__v': v, }; } } class NotificationResponse { String? returnMessage; List? notifications; NotificationResponse({this.returnMessage, this.notifications}); factory NotificationResponse.fromJson(Map json) { return NotificationResponse( returnMessage: json['return_message'], notifications: json['notifications'] != null ? List.from(json['notifications'] .map((notification) => NotificationModel.fromJson(notification))) : null, ); } Map toJson() { return { 'return_message': returnMessage, 'notifications': notifications?.map((notification) => notification.toJson()).toList(), }; } }