import 'package:muaawana/models/auth/current_user_response.dart'; class ChatRoomModel{ int? id; String? chatId; String? lastmessage; CurrentUser? sender; CurrentUser? recipient; ChatRoomModel({ this.id, this.chatId, this.lastmessage, this.sender, this.recipient, }); set setChatId(String value) { chatId = value; } factory ChatRoomModel.fromJson(Map json) => ChatRoomModel( id: json["id"], chatId: json["chatId"], lastmessage: json["lastmessage"], sender: CurrentUser.fromJson(json["sender"]), recipient: CurrentUser.fromJson(json["recipient"]), ); // Map toJson() => { // "id": id, // "chatId": chatId, // "lastmessage": lastmessage, // "sender": sender.toJson(), // "recipient": recipient.toJson(), // }; }