class Comment { Comment({ this.id, this.callRequestId, this.createdOn, this.createdBy, this.comment, }); Comment.fromJson(dynamic json) { id = json['id']; callRequestId = json['callRequestId']; createdOn = json['createdOn']; createdBy = json['createdBy'] != null ? CreatedBy.fromJson(json['createdBy']) : null; comment = json['comment']; } num id; num callRequestId; String createdOn; CreatedBy createdBy; String comment; Comment copyWith({ num id, num callRequestId, String createdOn, CreatedBy createdBy, String comment, }) => Comment( id: id ?? this.id, callRequestId: callRequestId ?? this.callRequestId, createdOn: createdOn ?? this.createdOn, createdBy: createdBy ?? this.createdBy, comment: comment ?? this.comment, ); Map toJson() { final map = {}; map['id'] = id; map['callRequestId'] = callRequestId; map['createdOn'] = createdOn; if (createdBy != null) { map['createdBy'] = createdBy.toJson(); } map['comment'] = comment; return map; } } class CreatedBy { CreatedBy({ this.userId, this.userName, }); CreatedBy.fromJson(dynamic json) { userId = json['userId']; userName = json['userName']; } String userId; String userName; CreatedBy copyWith({ String userId, String userName, }) => CreatedBy( userId: userId ?? this.userId, userName: userName ?? this.userName, ); Map toJson() { final map = {}; map['userId'] = userId; map['userName'] = userName; return map; } }