dateTimePickerWidget method
Implementation
dateTimePickerWidget(BuildContext context) {
return DatePicker.showDatePicker(
context,
dateFormat: 'dd MMMM yyyy HH:mm',
initialDateTime: DateTime.now(),
minDateTime: DateTime.now(),
maxDateTime: DateTime(3000),
onMonthChangeStartWithFirstDate: true,
onConfirm: (dateTime, List<int> index) {
DateTime selectdate = dateTime;
visualDate = DateFormat('dd-MM-yyyy HH:mm').format(selectdate);
selectdate = selectdate.toUtc();
backDate =
"${DateFormat('yyyy').format(selectdate)}-${DateFormat('MM').format(selectdate)}-${DateFormat('dd').format(selectdate)}T${DateFormat('HH').format(selectdate)}:${DateFormat('mm').format(selectdate)}:00.000Z";
},
onClose: () {
dateUpdate = true;
},
);
}