CarPart.fromJson constructor

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

Implementation

factory CarPart.fromJson(Map<String, dynamic> json) => CarPart(
      uuid: json['class_uuid'] ?? '',
      carPartClassName: json['car_part_name'] ?? '',
      carPartLocation: json['location'],
      carPartScore: json['score'],
      carPartBoxes: json['box'],
      carPartMaskPath: json['mask_path'],
      carPartMaskUrl: json['mask_url'],
      carPartIsPart: json['is_part'],
      carPartDamages: List<DamageModel>.from(
          json['damages'].map((e) => DamageModel.fromJson(e))),
      color: json['car_part_color'] != null
          ? HexColor.fromHex(json['car_part_color'])
          : Colors.transparent,
    );