Browse Source

update show plantingDate and sowingDate

bugfix/20250501
Đại Võ 7 months ago
parent
commit
a1f7802fc4
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

TbCropDTO? tbCropDTO; TbCropDTO? tbCropDTO;
List<Activities>? activities; List<Activities>? activities;
String? sowingDate; String? sowingDate;
String? plantingDate;
int? soakSeedsTime; int? soakSeedsTime;
num? seedIncubationTime; num? seedIncubationTime;
int? numberPlants; int? numberPlants;
int? numberCurrentPlants; int? numberCurrentPlants;
String? endOfFarmingDate; 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) { CropPlot.fromJson(Map<String, dynamic> json) {
tbCropDTO = json['tbCropDTO'] != null ? new TbCropDTO.fromJson(json['tbCropDTO']) : null; tbCropDTO = json['tbCropDTO'] != null ? new TbCropDTO.fromJson(json['tbCropDTO']) : null;
}); });
} }
sowingDate = json['sowingDate']; sowingDate = json['sowingDate'];
plantingDate = json['plantingDate'];
soakSeedsTime = json['soakSeedsTime']; soakSeedsTime = json['soakSeedsTime'];
seedIncubationTime = json['seedIncubationTime']; seedIncubationTime = json['seedIncubationTime'];
numberPlants = json['numberPlants']; numberPlants = json['numberPlants'];

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

WidgetRowPlotInfo( WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.1), color: AppColors.DEFAULT.withOpacity(0.1),
name: 'Ngày gieo trồng', 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( WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.3), color: AppColors.DEFAULT.withOpacity(0.3),
name: 'Ngày vô khây ươm', 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( WidgetRowPlotInfo(
color: AppColors.DEFAULT.withOpacity(0.1), color: AppColors.DEFAULT.withOpacity(0.1),
name: 'Thời gian ngâm hạt', name: 'Thời gian ngâm hạt',

Loading…
Cancel
Save