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(SuppliesUsing.fromJson(v));
      });
    }
  }

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