import 'SuppliesUsing.dart';

class Plant {
  int? id;
  int? cropId;
  int? activityId;
  String? executeDate;
  String? description;
  String? executeBy;
  String? density;
  num? quantity;
  String? media;
  List<String>? mediaDel;
  List<SuppliesUsing>? suppliesUsing;

  Plant(
      {this.id,
      this.activityId,
      this.cropId,
      this.executeDate,
      this.description,
      this.executeBy,
      this.density,
      this.quantity,
      this.media,
      this.mediaDel,
      this.suppliesUsing});

  Plant.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    activityId = json['activityId'];
    cropId = json['cropId'];
    executeDate = json['executeDate'];
    description = json['description'];
    executeBy = json['executeBy'];
    density = json['density'];
    quantity = json['quantity'];
    media = json['media'];
    if (json['suppliesUsing'] != null) {
      suppliesUsing = <SuppliesUsing>[];
      json['suppliesUsing'].forEach((v) {
        suppliesUsing?.add(new SuppliesUsing.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['activityId'] = this.activityId;
    data['cropId'] = this.cropId;
    data['executeDate'] = this.executeDate;
    data['description'] = this.description;
    data['executeBy'] = this.executeBy;
    data['density'] = this.density;
    data['quantity'] = this.quantity;
    data['media'] = this.media;
    data['media_del'] = this.mediaDel;
    if (this.suppliesUsing != null) {
      data['suppliesUsing'] = this.suppliesUsing?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
