mapToQBDialog static method

QBDialog? mapToQBDialog(
  1. Map? map
)

Implementation

static QBDialog? mapToQBDialog(Map<dynamic, dynamic>? map) {
  if (map == null || map.length <= 0) {
    return null;
  }

  QBDialog qbDialog = QBDialog();

  if (map.containsKey("createdAt")) {
    qbDialog.createdAt = map["createdAt"] as String?;
  }
  if (map.containsKey("lastMessage")) {
    qbDialog.lastMessage = map["lastMessage"] as String?;
  }
  if (map.containsKey("lastMessageDateSent")) {
    qbDialog.lastMessageDateSent = map["lastMessageDateSent"] as int?;
  }
  if (map.containsKey("lastMessageUserId")) {
    qbDialog.lastMessageUserId = map["lastMessageUserId"] as int?;
  }
  if (map.containsKey("name")) {
    qbDialog.name = map["name"] as String?;
  }
  if (map.containsKey("photo")) {
    qbDialog.photo = map["photo"] as String?;
  }
  if (map.containsKey("type")) {
    qbDialog.type = map["type"] as int?;
  }
  if (map.containsKey("unreadMessagesCount")) {
    qbDialog.unreadMessagesCount = map["unreadMessagesCount"] as int?;
  }
  if (map.containsKey("updatedAt")) {
    qbDialog.updatedAt = map["updatedAt"] as String?;
  }
  if (map.containsKey("userId")) {
    qbDialog.userId = map["userId"] as int?;
  }
  if (map.containsKey("roomJid")) {
    qbDialog.roomJid = map["roomJid"] as String?;
  }
  if (map.containsKey("id")) {
    qbDialog.id = map["id"] as String?;
  }
  if (map.containsKey("occupantsIds")) {
    List<Object?> list = map["occupantsIds"] as List<Object?>;
    qbDialog.occupantsIds = list.cast<int>();
  }
  if (map.containsKey("customData")) {
    qbDialog.customData = map["customData"] as Map<Object?, Object?>?;
  }

  return qbDialog;
}