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