fromJson method

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

Implementation

HarvestDiaryModel fromJson(Map<String, dynamic> json) {
  id = Util.getValueFromJson(json, 'id', -1);
  culture_plot_id = Util.getValueFromJson(json, 'culture_plot_id', -1);
  process_engineering_id = Util.getValueFromJson(json, 'process_engineering_id', -1);
  amount = double.parse(Util.getValueFromJson(json, 'amount', .0).toString());
  revenue = Util.getValueFromJson(json, 'revenue', .0);
  qr_code = Util.getValueFromJson(json, 'qr_code', '');
  title = Util.getValueFromJson(json, 'title', '');
  name = title;
  family_tree = Util.getValueFromJson(json, 'family_tree', '');
  culture_plot_title = Util.getValueFromJson(json, 'culture_plot_title', '');
  unit = Util.getValueFromJson(json, 'unit', '');
  other_unit = Util.getValueFromJson(json, 'other_unit', '');
  working_status = Util.getValueFromJson(json, 'working_status', 'working');
  process_engineering_title = Util.getValueFromJson(json, 'process_engineering_title', '');
  return this;
}