fromJson method

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

Implementation

TraceabilityManufactor fromJson(Map<String, dynamic> json) {
  try {
    id = Util.isNullFromJson(json, 'id') ? json['id'] : -1;

    lot_number = Util.isNullFromJson(json, 'lot_number') ? json['lot_number'] : -1;

    traceability_id = Util.isNullFromJson(json, 'traceability_id') ? json['traceability_id'] : 0;

    ingredient_name = Util.isNullFromJson(json, 'ingredient_name') ? json['ingredient_name'] : '';

    ingredient_quantily = Util.isNullFromJson(json, 'ingredient_quantily') ? json['ingredient_quantily'] : -1;

    created_at = Util.isNullFromJson(json, 'created_at') ? json['created_at'] : '';

    ingredient_note = Util.isNullFromJson(json, 'ingredient_note') ? json['ingredient_note'] : '';

    manufacture_phone = Util.isNullFromJson(json, 'manufacture_phone') ? json['manufacture_phone'] : '';

    manufacture_name = Util.isNullFromJson(json, 'manufacture_name') ? json['manufacture_name'] : '';

    manufacture_address = Util.isNullFromJson(json, 'manufacture_address') ? json['manufacture_address'] : '';

    manufacture_email = Util.isNullFromJson(json, 'manufacture_email') ? json['manufacture_email'] : '';

    updated_at = Util.isNullFromJson(json, 'updated_at') ? json['updated_at'] : '';

    traceability_type = Util.isNullFromJson(json, 'traceability_type') ? json['traceability_type'] : '';

    if (Util.isNullFromJson(json, 'images')) images.fromJson(json['images']);
  } catch (e) {
    return TraceabilityManufactor();
  }
  return this;
}