AiImage.fromJson constructor

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

Implementation

factory AiImage.fromJson(Map<String, dynamic> json) => AiImage(
      imageId: json["imageId"],
      imageName: json["imageName"],
      claimId: json["claimId"],
      url: json["url"],
      imageSize: json["imageSize"] != null && json["imageSize"] is List
          ? List<double>.from(json["imageSize"].map((x) => x.toDouble()))
          : [],
      partDirectionName: json["partDirectionName"] ?? json["directionName"],
      imageRangeName: json["imageRangeName"],
      totalItem: json["totalItem"],
      damageExist: json["damageExist"],
      damageMasks: json["damageMasks"] != null
          ? List<MaskData>.from(
              json["damageMasks"].map((e) => MaskData.fromJson(e))).toList()
          : [],
      partsMasks: json["partsMasks"] != null
          ? List<PartsMask>.from(
              json["partsMasks"].map((x) => PartsMask.fromJson(x))).toList()
          : [],
      deletedFlag: json["deletedFlag"],
      createdDate: json["createdDate"] != null
          ? DateTime.parse(json["createdDate"])
          : DateTime.now(),
      updatedDate: json["updatedDate"] != null
          ? DateTime.parse(json["updatedDate"])
          : DateTime.now(),
      createdBy: json["createdBy"],
      timeProcess:
          json['timeProcess'] != null ? json['timeProcess'].toDouble() : 0.0,
      errorNote: json['errorNote'],
      errorType: json['errorType'] != null
          ? List<String>.from(json['errorType'].map((e) => e.toString()))
              .toList()
          : [],
    );