@ -91,6 +91,7 @@ class _PentryCalibrationToolFormState extends State<PentryCalibrationToolForm> {
ADatePicker(
label: context.translation.calibrationDate,
date: DateTime.tryParse(model.calibrationDateOfTesters ?? ""),
from: DateTime.now().subtract(const Duration(days: 90)),
backgroundColor: context.isDark ? AppColor.neutral50 : AppColor.background(context),
withBorder: false,
onDatePicker: (date) {
@ -87,6 +87,11 @@ class _PentryTBSFormState extends State<PentryTBSForm> {
from: DateTime.now().subtract(const Duration(days: 30)),
if (date == null) return;
if (date.isBefore(DateTime.parse(widget.model.expectedDate))) {
"Actual visit date must be greater then expected date".showToast;
return;
}
widget.model.actualDate = date?.toIso8601String();
setState(() {});
},