fromJson method
Implementation
TraceabilityResutlModel fromJson(Map<String, dynamic> json) {
try {
id = Util.isNullFromJson(json, 'id') ? json['id'] : -1;
code = Util.isNullFromJson(json, 'code') ? json['code'] : '';
qr_code = Util.isNullFromJson(json, 'qr_code') ? json['qr_code'] : '';
created_at = Util.isNullFromJson(json, 'created_at') ? json['created_at'] : '';
date_of_manufacture = Util.isNullFromJson(json, 'date_of_manufacture') ? json['date_of_manufacture'] : '';
expiry_date = Util.isNullFromJson(json, 'expiry_date') ? json['expiry_date'] : '';
lot_code = Util.isNullFromJson(json, 'lot_code') ? json['lot_code'].toString() : '';
name = Util.isNullFromJson(json, 'name') ? json['name'] : '';
packing_way = Util.isNullFromJson(json, 'packing_way') ? json['packing_way'] : '';
certification = Util.isNullFromJson(json, 'certification') ? json['certification'] : '';
description = Util.isNullFromJson(json, 'description') ? json['description'] : '';
number_of_quarantine_days = Util.isNullFromJson(json, 'number_of_quarantine_days') ? json['number_of_quarantine_days'].toString() : '';
if (Util.isNullFromJson(json, 'list_images')) list_images.fromJson(json['list_images']);
if (Util.isNullFromJson(json, 'ingredient')) ingredient.fromJson(json['ingredient']);
if (Util.isNullFromJson(json, 'manufactor')) manufactor.fromJson(json['manufactor']);
if (Util.isNullFromJson(json, 'video')) video.fromJson(json['video']);
} catch (e) {
return TraceabilityResutlModel();
}
return this;
}