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