ChatSession.fromJson constructor

ChatSession.fromJson(
  1. Map<String, dynamic> json
)

Implementation

ChatSession.fromJson(Map<String, dynamic> json) {
  agentName = json['agentName'];
  email = json['email'];
  businessId = json['businessId'];
  customer = json['customer'];
  phoneNo = json['phoneNo'];
  message =
      json['message'] != null ? Message.fromJson(json['message']) : null;

  escalated = json['escalated'];
  sentiment = json['sentiment'];
  channel = json['channel'];
  category = json['category'];
  type = json['type'];
  department = json['department'];
  escalationDepartment = json['escalation_department'];
  title = json['title'];
  // if (json['titles'] != null) {
  //   titles = <MessagesData>[];
  //   json['titles'].forEach((v) {
  //     titles!.add(MessagesData.fromJson(v));
  //   });
  // }
  isCompleted = json['isCompleted'];
  createdDate = json['created_date'];
  updateDate = json['update_date'];
  createdAt = DateTime.tryParse(json['createdAt'] ?? '');
  updatedAt = DateTime.tryParse(json['updatedAt'] ?? '');
  id = json['id'];
}