| tbCropDTO = json['tbCropDTO'] != null | tbCropDTO = json['tbCropDTO'] != null | ||||
| ? new TbCropDTO.fromJson(json['tbCropDTO']) | ? new TbCropDTO.fromJson(json['tbCropDTO']) | ||||
| : null; | : null; | ||||
| if (json['activityTimeline'] != null) { | |||||
| if (json['activities'] != null) { | |||||
| activities = new List<Activities>(); | activities = new List<Activities>(); | ||||
| json['activityTimeline'].forEach((v) { | |||||
| json['activities'].forEach((v) { | |||||
| activities.add(new Activities.fromJson(v)); | activities.add(new Activities.fromJson(v)); | ||||
| }); | }); | ||||
| } | } | ||||
| data['tbCropDTO'] = this.tbCropDTO.toJson(); | data['tbCropDTO'] = this.tbCropDTO.toJson(); | ||||
| } | } | ||||
| if (this.activities != null) { | if (this.activities != null) { | ||||
| data['activityTimeline'] = | |||||
| this.activities.map((v) => v.toJson()).toList(); | |||||
| data['activities'] = this.activities.map((v) => v.toJson()).toList(); | |||||
| } | } | ||||
| data['sowingDate'] = this.sowingDate; | data['sowingDate'] = this.sowingDate; | ||||
| data['soakSeedsTime'] = this.soakSeedsTime; | data['soakSeedsTime'] = this.soakSeedsTime; |
| //Crop | //Crop | ||||
| @GET( | @GET( | ||||
| "/api/tb-crops-detail/{cropId}?page={page}&size={size}&sort=executeDate,DESC") | |||||
| "/api/tb-crops-detail-for-app/{cropId}?page={page}&size={size}&sort=executeDate,DESC") | |||||
| Future<CropPlot> getCropDetail(@Path() int cropId, | Future<CropPlot> getCropDetail(@Path() int cropId, | ||||
| {@Path() int page = 0, @Path() int size = 20}); | {@Path() int page = 0, @Path() int size = 20}); | ||||
| queryParameters.removeWhere((k, v) => v == null); | queryParameters.removeWhere((k, v) => v == null); | ||||
| final _data = <String, dynamic>{}; | final _data = <String, dynamic>{}; | ||||
| final Response<Map<String, dynamic>> _result = await _dio.request( | final Response<Map<String, dynamic>> _result = await _dio.request( | ||||
| '/api/tb-crops-detail/$cropId?page=$page&size=$size&sort=executeDate,DESC', | |||||
| '/api/tb-crops-detail-for-app/$cropId?page=$page&size=$size&sort=executeDate,DESC', | |||||
| queryParameters: queryParameters, | queryParameters: queryParameters, | ||||
| options: RequestOptions( | options: RequestOptions( | ||||
| method: 'GET', | method: 'GET', |