import 'package:muaawana/models/auth/current_user_response.dart'; import 'package:muaawana/models/chat_v2/message.dart'; class NotificationsModel{ int? id; CurrentUser? sender; CurrentUser? recipient; MessageModel? chat; // MeetingModel? meeting; int? timestmp; NotificationsModel({ this.id, this.sender, this.recipient, this.chat, // this.meeting, this.timestmp, }); factory NotificationsModel.fromJson(Map json) => NotificationsModel( id: json["id"], sender: CurrentUser.fromJson(json["sender"]), recipient: CurrentUser.fromJson(json["recipient"]), chat: json["chat"]==null?null:MessageModel.fromJson(json["chat"]), // meeting: json["meeting"]==null?null:MeetingModel.fromJson(json["meeting"]), timestmp: json["timestmp"], ); Map toJson() => { "id": id, "sender": sender?.toJson(), "recipient": recipient?.toJson(), "chat": chat?.toJson(), // "meeting": meeting.toJson(), "timestmp": timestmp, }; }