Conversation.fromMap constructor

Conversation.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory Conversation.fromMap(Map<String, dynamic> json) => Conversation(
  id: getString(json["id"]),
  createdAt: getDateTime(json["createdAt"]),
  lastQueryTime: json["lastQueryTimestamp"] != null
      ? getDateTime(json["lastQueryTimestamp"])
      : null,
  title: getString(json["title"]),
  token: getString(json["token"]),
  userId: getString(json["userId"]),
  assistantId: getString(json["chatBotId"]),
  queryCount: getInt(json["queryCount"]),
  rating: json["reaction"]?["rating"] != null
      ? getInt(json["reaction"]?["rating"])
      : null,
  comment: getString(json["reaction"]?["comment"]),
  userName: getString(json["user"]?["name"]),
  userSurname: getString(json["user"]?["surname"]),
);