Browse Source

update show plantingDate and sowingDate

phase2_apinhatky
Đại Võ 7 months ago
parent
commit
05aaf2417c
2 changed files with 15 additions and 15 deletions
  1. +13
    -9
      lib/custom_model/CropPlot.dart
  2. +2
    -6
      lib/presentation/screens/plot_detail/sc_plot_information.dart

+ 13
- 9
lib/custom_model/CropPlot.dart View File

@@ -4,21 +4,24 @@ class CropPlot {
TbCropDTO? tbCropDTO;
List<Activities>? activities;
String? sowingDate;
String? plantingDate;
int? soakSeedsTime;
num? seedIncubationTime;
int? numberPlants;
int? numberCurrentPlants;
String? endOfFarmingDate;

CropPlot(
{this.tbCropDTO,
this.activities,
this.sowingDate,
this.soakSeedsTime,
this.seedIncubationTime,
this.numberPlants,
this.numberCurrentPlants,
this.endOfFarmingDate});
CropPlot({
this.tbCropDTO,
this.activities,
this.sowingDate,
this.plantingDate,
this.soakSeedsTime,
this.seedIncubationTime,
this.numberPlants,
this.numberCurrentPlants,
this.endOfFarmingDate,
});

CropPlot.fromJson(Map<String, dynamic> json) {
tbCropDTO = json['tbCropDTO'] != null ? new TbCropDTO.fromJson(json['tbCropDTO']) : null;
@@ -29,6 +32,7 @@ class CropPlot {
});
}
sowingDate = json['sowingDate'];
plantingDate = json['plantingDate'];
soakSeedsTime = json['soakSeedsTime'];
seedIncubationTime = json['seedIncubationTime'];
numberPlants = json['numberPlants'];

+ 2
- 6
lib/presentation/screens/plot_detail/sc_plot_information.dart View File

@@ -141,15 +141,11 @@ class _PlotInformationScreenState extends State<PlotInformationScreen> with Auto
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.1),
name: 'Ngày gieo trồng',
value: cropPlot.tbCropDTO?.tbCropTypeId == 0
? '${cropPlot.tbCropDTO?.startDate?.format_DDMMYY_HHmm() ?? '--'}'
: '--'),
value: cropPlot.tbCropDTO?.tbCropTypeId == 0 ? '${cropPlot.plantingDate?.format_DDMMYY_HHmm() ?? '--'}' : '--'),
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.3),
name: 'Ngày vô khây ươm',
value: cropPlot.tbCropDTO?.tbCropTypeId == 1
? '${cropPlot.tbCropDTO?.startDate?.format_DDMMYY_HHmm() ?? '--'}'
: '--'),
value: cropPlot.tbCropDTO?.tbCropTypeId == 1 ? '${cropPlot.sowingDate?.format_DDMMYY_HHmm() ?? '--'}' : '--'),
WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.1),
name: 'Thời gian ngâm hạt',

Loading…
Cancel
Save