|
- import 'SuppliesUsing.dart';
-
- class Spraying {
- int id;
- int activityId;
- int cropId;
- String media;
- String executeDate;
- num quarantinePeriod;
- String resultAt;
- String weatherConditions;
- String purpose;
- String description;
- String executeBy;
- List<SuppliesUsing> suppliesUsing;
-
- Spraying(
- {this.id,
- this.activityId,
- this.cropId,
- this.media,
- this.executeDate,
- this.quarantinePeriod,
- this.resultAt,
- this.weatherConditions,
- this.purpose,
- this.description,
- this.executeBy,
- this.suppliesUsing});
-
- Spraying.fromJson(Map<String, dynamic> json) {
- id = json['id'];
- activityId = json['activityId'];
- cropId = json['cropId'];
- media = json['media'];
- executeDate = json['executeDate'];
- quarantinePeriod = json['quarantinePeriod'];
- resultAt = json['resultAt'];
- weatherConditions = json['weatherConditions'];
- purpose = json['purpose'];
- description = json['description'];
- executeBy = json['executeBy'];
- if (json['suppliesUsing'] != null) {
- suppliesUsing = new List<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['media'] = this.media;
- data['executeDate'] = this.executeDate;
- data['quarantinePeriod'] = this.quarantinePeriod;
- data['resultAt'] = this.resultAt;
- data['weatherConditions'] = this.weatherConditions;
- data['purpose'] = this.purpose;
- data['description'] = this.description;
- data['executeBy'] = this.executeBy;
- if (this.suppliesUsing != null) {
- data['suppliesUsing'] =
- this.suppliesUsing.map((v) => v.toJson()).toList();
- }
- return data;
- }
- }
|