showPopup method
void
showPopup(
- BuildContext context,
- int hours,
- int minutes,
- dynamic onClose(
- DateTime endDate
Implementation
void showPopup(BuildContext context, int hours, int minutes, Function(DateTime endDate) onClose) {
DateTime today = DateTime.now();
DateTime selectedDate = DateTime(today.year, today.month, today.day, hours, minutes);
showDialog(
context: context,
builder: (BuildContext context) => NsgPopUp(
height: (!kIsWeb && (Platform.isIOS || Platform.isAndroid)) ? 420 : 120,
title: tran.enter_time,
onConfirm: () {
onClose(selectedDate);
},
onCancel: () {
Navigator.pop(context);
},
getContent: () => [
TimePickerContent(
dateForTime: dateForTime,
initialTime: Jiffy.parseFromDateTime(DateTime(0)).addDuration(initialTime).dateTime,
onChange: ((endDate) {
selectedDate = endDate;
}),
// onClose,
),
],
),
);
}