class ChatParticipantModel { int? id; String? title; String? conversationType; List? participants; String? lastMessage; String? createdAt; ChatParticipantModel({this.id, this.title, this.conversationType, this.participants, this.lastMessage, this.createdAt}); ChatParticipantModel.fromJson(Map json) { id = json['id']; title = json['title']; conversationType = json['conversationType']; if (json['participants'] != null) { participants = []; json['participants'].forEach((v) { participants!.add(new Participants.fromJson(v)); }); } lastMessage = json['lastMessage']; createdAt = json['createdAt']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['title'] = this.title; data['conversationType'] = this.conversationType; if (this.participants != null) { data['participants'] = this.participants!.map((v) => v.toJson()).toList(); } data['lastMessage'] = this.lastMessage; data['createdAt'] = this.createdAt; return data; } } class Participants { String? userId; String? userName; String? employeeNumber; String? role; int? userStatus; Participants({this.userId, this.userName, this.employeeNumber, this.role, this.userStatus}); Participants.fromJson(Map json) { userId = json['userId']; userName = json['userName']; employeeNumber = json['employeeNumber']; role = json['role']; userStatus = json['userStatus']; } Map toJson() { final Map data = new Map(); data['userId'] = this.userId; data['userName'] = this.userName; data['employeeNumber'] = this.employeeNumber; data['role'] = this.role; data['userStatus'] = this.userStatus; return data; } }