showPopup method
Implementation
void showPopup(BuildContext context, DateTime date, Function(DateTime endDate) onClose) {
DateTime selectedDate = date;
//Если не задана дата (<1755) устанавливаем initialTime как начальную
//Иначе, при нажатии на галку не происходит выбор даты
if (selectedDate.year < 1800) {
selectedDate = initialTime;
}
showDialog(
context: context,
builder: (BuildContext context) => NsgPopUp(
title: tran.select_date,
//height: 410,
onConfirm: () {
onClose(selectedDate);
},
onCancel: () {
Navigator.of(context).pop();
//Get.back();
},
getContent: () => [
DatePickerContent(
textAlign: textAlign,
firstDateTime: firstDateTime,
lastDateTime: lastDateTime,
initialTime: initialTime,
onChange: (endDate) {
selectedDate = endDate;
},
),
],
),
);
}