mapToQBAttachment static method

QBAttachment? mapToQBAttachment(
  1. Map? map
)

Implementation

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

  QBAttachment qbAttachment = QBAttachment();

  if (map.containsKey("type") && map["type"] != null) {
    qbAttachment.type = map["type"] as String?;
  }
  if (map.containsKey("id") && map["id"] != null) {
    qbAttachment.id = map["id"] as String?;
  }
  if (map.containsKey("url") && map["url"] != null) {
    qbAttachment.url = map["url"] as String?;
  }
  if (map.containsKey("name") && map["name"] != null) {
    qbAttachment.name = map["name"] as String?;
  }
  if (map.containsKey("contentType") && map["contentType"] != null) {
    qbAttachment.contentType = map["contentType"] as String?;
  }
  if (map.containsKey("data") && map["data"] != null) {
    qbAttachment.data = map["data"] as String?;
  }
  if (map.containsKey("size") && map["size"] != null) {
    qbAttachment.size = map["size"] as double?;
  }
  if (map.containsKey("height") && map["height"] != null) {
    qbAttachment.height = map["height"] as int?;
  }
  if (map.containsKey("width") && map["width"] != null) {
    qbAttachment.width = map["width"] as int?;
  }
  if (map.containsKey("duration") && map["duration"] != null) {
    qbAttachment.duration = map["duration"] as int?;
  }

  return qbAttachment;
}